Root/target/linux/omap24xx/patches-2.6.38/590-cbus-tahvo-usb-ptr-fix.patch

1--- a/drivers/cbus/tahvo-usb.c
2+++ b/drivers/cbus/tahvo-usb.c
3@@ -99,7 +99,7 @@ struct tahvo_usb {
4     int tahvo_mode;
5 #endif
6 };
7-static struct platform_device tahvo_usb_device;
8+static struct tahvo_usb *tahvo_usb_device;
9 
10 /*
11  * ---------------------------------------------------------------------------
12@@ -114,8 +114,7 @@ static struct platform_device *tahvo_otg
13 
14 static irqreturn_t omap_otg_irq(int irq, void *arg)
15 {
16- struct platform_device *otg_dev = arg;
17- struct tahvo_usb *tu = platform_get_drvdata(otg_dev);
18+ struct tahvo_usb *tu = arg;
19     u16 otg_irq;
20 
21     otg_irq = omap_readw(OTG_IRQ_SRC);
22@@ -201,12 +200,12 @@ static int __init omap_otg_probe(struct
23 
24     return request_irq(tahvo_otg_dev->resource[1].start,
25                omap_otg_irq, IRQF_DISABLED, DRIVER_NAME,
26- &tahvo_usb_device);
27+ tahvo_usb_device);
28 }
29 
30 static int __exit omap_otg_remove(struct platform_device *pdev)
31 {
32- free_irq(tahvo_otg_dev->resource[1].start, &tahvo_usb_device);
33+ free_irq(tahvo_otg_dev->resource[1].start, tahvo_usb_device);
34     tahvo_otg_dev = NULL;
35 
36     return 0;
37@@ -659,6 +658,7 @@ static int __init tahvo_usb_probe(struct
38     tu = kzalloc(sizeof(*tu), GFP_KERNEL);
39     if (!tu)
40         return -ENOMEM;
41+ tahvo_usb_device = tu;
42 
43     tu->pt_dev = container_of(dev, struct platform_device, dev);
44 #ifdef CONFIG_USB_OTG
45@@ -682,6 +682,7 @@ static int __init tahvo_usb_probe(struct
46                 (unsigned long) tu, "vbus_interrupt");
47     if (ret != 0) {
48         kfree(tu);
49+ tahvo_usb_device = NULL;
50         printk(KERN_ERR "Could not register Tahvo interrupt for VBUS\n");
51         return ret;
52     }
53@@ -708,6 +709,7 @@ static int __init tahvo_usb_probe(struct
54     ret = otg_set_transceiver(&tu->otg);
55     if (ret < 0) {
56         printk(KERN_ERR "Cannot register USB transceiver\n");
57+ tahvo_usb_device = NULL;
58         kfree(tu);
59         tahvo_free_irq(TAHVO_INT_VBUSON);
60         return ret;
61@@ -732,6 +734,8 @@ static int __exit tahvo_usb_remove(struc
62 #ifdef CONFIG_USB_OTG
63     device_remove_file(&pdev->dev, &dev_attr_otg_mode);
64 #endif
65+ tahvo_usb_device = NULL;
66+
67     return 0;
68 }
69 
70

Archive Download this file



interactive