diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2008-11-02 09:25:42 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-11-13 17:45:03 -0500 |
commit | ff30bf1ca4b548c0928dae6bfce89458b95e5bf4 (patch) | |
tree | fcc7d0fdc68c0d650a95e8ed70d4bc4f9b569dcc /drivers/usb | |
parent | 9a18e75fc443d24d25ee0fcf892a64a9741f6294 (diff) |
USB: remove optional bus bindings in isp1760, fixing runtime warning
Roland Reported the following:
| kmem_cache_create: duplicate cache isp1760_qtd
| Pid: 461, comm: modprobe Tainted: G W 2.6.28-rc2-git3-default #4
| Call Trace:
| [<c017540e>] kmem_cache_create+0xc9/0x3a3
| [<c0159a8d>] free_pages_bulk+0x16c/0x1c9
| [<f165c05f>] isp1760_init+0x0/0xb [isp1760]
| [<f165c018>] init_kmem_once+0x18/0x5f [isp1760]
| [<f165c064>] isp1760_init+0x5/0xb [isp1760]
| [<c010113d>] _stext+0x4d/0x148
| [<c0142936>] load_module+0x12cd/0x142e
| [<c01743c4>] kmem_cache_destroy+0x0/0xd7
| [<c0142b1e>] sys_init_module+0x87/0x176
| [<c01039eb>] sysenter_do_call+0x12/0x2f
The reason, is that ret is initialized with ENODEV instead of 0 _or_
the kmem cache is not freed in error case with no bus binding.
The difference between OF+PCI and OF only is
| 15148 804 32 15984 3e70 isp1760-of-pci.o
| 13748 676 8 14432 3860 isp1760-of.o
about 1.5 KiB.
Until there is a checkbox where the user *must* select atleast one item,
and may select multiple entries I don't make it selectable anymore.
Having a driver which can't be used under any circumstances is broken
anyway and I've seen distros shipping it that way.
Reported-by: Roland Kletzing <devzero@web.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>a
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/Kconfig | 23 | ||||
-rw-r--r-- | drivers/usb/host/isp1760-if.c | 22 |
2 files changed, 17 insertions, 28 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 56f592dc0b36..f3a75a929e0a 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -110,29 +110,18 @@ config USB_ISP116X_HCD | |||
110 | 110 | ||
111 | config USB_ISP1760_HCD | 111 | config USB_ISP1760_HCD |
112 | tristate "ISP 1760 HCD support" | 112 | tristate "ISP 1760 HCD support" |
113 | depends on USB && EXPERIMENTAL | 113 | depends on USB && EXPERIMENTAL && (PCI || PPC_OF) |
114 | ---help--- | 114 | ---help--- |
115 | The ISP1760 chip is a USB 2.0 host controller. | 115 | The ISP1760 chip is a USB 2.0 host controller. |
116 | 116 | ||
117 | This driver does not support isochronous transfers or OTG. | 117 | This driver does not support isochronous transfers or OTG. |
118 | This USB controller is usually attached to a non-DMA-Master | ||
119 | capable bus. NXP's eval kit brings this chip on PCI card | ||
120 | where the chip itself is behind a PLB to simulate such | ||
121 | a bus. | ||
118 | 122 | ||
119 | To compile this driver as a module, choose M here: the | 123 | To compile this driver as a module, choose M here: the |
120 | module will be called isp1760-hcd. | 124 | module will be called isp1760. |
121 | |||
122 | config USB_ISP1760_PCI | ||
123 | bool "Support for the PCI bus" | ||
124 | depends on USB_ISP1760_HCD && PCI | ||
125 | ---help--- | ||
126 | Enables support for the device present on the PCI bus. | ||
127 | This should only be required if you happen to have the eval kit from | ||
128 | NXP and you are going to test it. | ||
129 | |||
130 | config USB_ISP1760_OF | ||
131 | bool "Support for the OF platform bus" | ||
132 | depends on USB_ISP1760_HCD && PPC_OF | ||
133 | ---help--- | ||
134 | Enables support for the device present on the PowerPC | ||
135 | OpenFirmware platform bus. | ||
136 | 125 | ||
137 | config USB_OHCI_HCD | 126 | config USB_OHCI_HCD |
138 | tristate "OHCI HCD support" | 127 | tristate "OHCI HCD support" |
diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c index af849f596135..b87ca7cf4b37 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c | |||
@@ -14,16 +14,16 @@ | |||
14 | #include "../core/hcd.h" | 14 | #include "../core/hcd.h" |
15 | #include "isp1760-hcd.h" | 15 | #include "isp1760-hcd.h" |
16 | 16 | ||
17 | #ifdef CONFIG_USB_ISP1760_OF | 17 | #ifdef CONFIG_PPC_OF |
18 | #include <linux/of.h> | 18 | #include <linux/of.h> |
19 | #include <linux/of_platform.h> | 19 | #include <linux/of_platform.h> |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #ifdef CONFIG_USB_ISP1760_PCI | 22 | #ifdef CONFIG_PCI |
23 | #include <linux/pci.h> | 23 | #include <linux/pci.h> |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | #ifdef CONFIG_USB_ISP1760_OF | 26 | #ifdef CONFIG_PPC_OF |
27 | static int of_isp1760_probe(struct of_device *dev, | 27 | static int of_isp1760_probe(struct of_device *dev, |
28 | const struct of_device_id *match) | 28 | const struct of_device_id *match) |
29 | { | 29 | { |
@@ -128,7 +128,7 @@ static struct of_platform_driver isp1760_of_driver = { | |||
128 | }; | 128 | }; |
129 | #endif | 129 | #endif |
130 | 130 | ||
131 | #ifdef CONFIG_USB_ISP1760_PCI | 131 | #ifdef CONFIG_PCI |
132 | static u32 nxp_pci_io_base; | 132 | static u32 nxp_pci_io_base; |
133 | static u32 iolength; | 133 | static u32 iolength; |
134 | static u32 pci_mem_phy0; | 134 | static u32 pci_mem_phy0; |
@@ -288,28 +288,28 @@ static struct pci_driver isp1761_pci_driver = { | |||
288 | 288 | ||
289 | static int __init isp1760_init(void) | 289 | static int __init isp1760_init(void) |
290 | { | 290 | { |
291 | int ret = -ENODEV; | 291 | int ret; |
292 | 292 | ||
293 | init_kmem_once(); | 293 | init_kmem_once(); |
294 | 294 | ||
295 | #ifdef CONFIG_USB_ISP1760_OF | 295 | #ifdef CONFIG_PPC_OF |
296 | ret = of_register_platform_driver(&isp1760_of_driver); | 296 | ret = of_register_platform_driver(&isp1760_of_driver); |
297 | if (ret) { | 297 | if (ret) { |
298 | deinit_kmem_cache(); | 298 | deinit_kmem_cache(); |
299 | return ret; | 299 | return ret; |
300 | } | 300 | } |
301 | #endif | 301 | #endif |
302 | #ifdef CONFIG_USB_ISP1760_PCI | 302 | #ifdef CONFIG_PCI |
303 | ret = pci_register_driver(&isp1761_pci_driver); | 303 | ret = pci_register_driver(&isp1761_pci_driver); |
304 | if (ret) | 304 | if (ret) |
305 | goto unreg_of; | 305 | goto unreg_of; |
306 | #endif | 306 | #endif |
307 | return ret; | 307 | return ret; |
308 | 308 | ||
309 | #ifdef CONFIG_USB_ISP1760_PCI | 309 | #ifdef CONFIG_PCI |
310 | unreg_of: | 310 | unreg_of: |
311 | #endif | 311 | #endif |
312 | #ifdef CONFIG_USB_ISP1760_OF | 312 | #ifdef CONFIG_PPC_OF |
313 | of_unregister_platform_driver(&isp1760_of_driver); | 313 | of_unregister_platform_driver(&isp1760_of_driver); |
314 | #endif | 314 | #endif |
315 | deinit_kmem_cache(); | 315 | deinit_kmem_cache(); |
@@ -319,10 +319,10 @@ module_init(isp1760_init); | |||
319 | 319 | ||
320 | static void __exit isp1760_exit(void) | 320 | static void __exit isp1760_exit(void) |
321 | { | 321 | { |
322 | #ifdef CONFIG_USB_ISP1760_OF | 322 | #ifdef CONFIG_PPC_OF |
323 | of_unregister_platform_driver(&isp1760_of_driver); | 323 | of_unregister_platform_driver(&isp1760_of_driver); |
324 | #endif | 324 | #endif |
325 | #ifdef CONFIG_USB_ISP1760_PCI | 325 | #ifdef CONFIG_PCI |
326 | pci_unregister_driver(&isp1761_pci_driver); | 326 | pci_unregister_driver(&isp1761_pci_driver); |
327 | #endif | 327 | #endif |
328 | deinit_kmem_cache(); | 328 | deinit_kmem_cache(); |