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