diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-09-23 17:20:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-09-26 18:51:14 -0400 |
commit | 0cc47d547d7a482434926331265b3713381b1e60 (patch) | |
tree | 77530e02def9808bf064bdbe48e9fc339f4b832e /drivers/usb | |
parent | 552e0c4f12fef0ad1caf21d2b57ac3a2735edef3 (diff) |
usb/xhci: remove CONFIG_PCI in xhci.c's probe function
This removes the need of ifdefs within the init function and with it the
headache about the correct clean without bus X but with bus/platform Y &
Z.
xhci-pci is only compiled if CONFIG_PCI is selected which can be
de-selected now without trouble. For now the result is kinda useless
because we have no other glue code. However, since nobody is using
USB_ARCH_HAS_XHCI then it should not be an issue :)
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/Makefile | 3 | ||||
-rw-r--r-- | drivers/usb/host/xhci-pci.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 7 | ||||
-rw-r--r-- | drivers/usb/host/xhci.h | 3 |
4 files changed, 8 insertions, 9 deletions
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index 624a362f2fee..ed48a5d79e16 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile | |||
@@ -11,8 +11,9 @@ fhci-y += fhci-mem.o fhci-tds.o fhci-sched.o | |||
11 | 11 | ||
12 | fhci-$(CONFIG_FHCI_DEBUG) += fhci-dbg.o | 12 | fhci-$(CONFIG_FHCI_DEBUG) += fhci-dbg.o |
13 | 13 | ||
14 | xhci-hcd-y := xhci.o xhci-mem.o xhci-pci.o | 14 | xhci-hcd-y := xhci.o xhci-mem.o |
15 | xhci-hcd-y += xhci-ring.o xhci-hub.o xhci-dbg.o | 15 | xhci-hcd-y += xhci-ring.o xhci-hub.o xhci-dbg.o |
16 | xhci-hcd-$(CONFIG_PCI) += xhci-pci.o | ||
16 | 17 | ||
17 | obj-$(CONFIG_USB_WHCI_HCD) += whci/ | 18 | obj-$(CONFIG_USB_WHCI_HCD) += whci/ |
18 | 19 | ||
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index e2c82d1249c2..9f51f88cc0f5 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -320,12 +320,12 @@ static struct pci_driver xhci_pci_driver = { | |||
320 | #endif | 320 | #endif |
321 | }; | 321 | }; |
322 | 322 | ||
323 | int xhci_register_pci(void) | 323 | int __init xhci_register_pci(void) |
324 | { | 324 | { |
325 | return pci_register_driver(&xhci_pci_driver); | 325 | return pci_register_driver(&xhci_pci_driver); |
326 | } | 326 | } |
327 | 327 | ||
328 | void xhci_unregister_pci(void) | 328 | void __exit xhci_unregister_pci(void) |
329 | { | 329 | { |
330 | pci_unregister_driver(&xhci_pci_driver); | 330 | pci_unregister_driver(&xhci_pci_driver); |
331 | } | 331 | } |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 2409bbe1b223..1ff95a0df576 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -4039,16 +4039,13 @@ MODULE_LICENSE("GPL"); | |||
4039 | 4039 | ||
4040 | static int __init xhci_hcd_init(void) | 4040 | static int __init xhci_hcd_init(void) |
4041 | { | 4041 | { |
4042 | #ifdef CONFIG_PCI | 4042 | int retval; |
4043 | int retval = 0; | ||
4044 | 4043 | ||
4045 | retval = xhci_register_pci(); | 4044 | retval = xhci_register_pci(); |
4046 | |||
4047 | if (retval < 0) { | 4045 | if (retval < 0) { |
4048 | printk(KERN_DEBUG "Problem registering PCI driver."); | 4046 | printk(KERN_DEBUG "Problem registering PCI driver."); |
4049 | return retval; | 4047 | return retval; |
4050 | } | 4048 | } |
4051 | #endif | ||
4052 | /* | 4049 | /* |
4053 | * Check the compiler generated sizes of structures that must be laid | 4050 | * Check the compiler generated sizes of structures that must be laid |
4054 | * out in specific ways for hardware access. | 4051 | * out in specific ways for hardware access. |
@@ -4073,8 +4070,6 @@ module_init(xhci_hcd_init); | |||
4073 | 4070 | ||
4074 | static void __exit xhci_hcd_cleanup(void) | 4071 | static void __exit xhci_hcd_cleanup(void) |
4075 | { | 4072 | { |
4076 | #ifdef CONFIG_PCI | ||
4077 | xhci_unregister_pci(); | 4073 | xhci_unregister_pci(); |
4078 | #endif | ||
4079 | } | 4074 | } |
4080 | module_exit(xhci_hcd_cleanup); | 4075 | module_exit(xhci_hcd_cleanup); |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index ad11c38afe85..3c8fbd2772ea 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1644,6 +1644,9 @@ void xhci_free_command(struct xhci_hcd *xhci, | |||
1644 | /* xHCI PCI glue */ | 1644 | /* xHCI PCI glue */ |
1645 | int xhci_register_pci(void); | 1645 | int xhci_register_pci(void); |
1646 | void xhci_unregister_pci(void); | 1646 | void xhci_unregister_pci(void); |
1647 | #else | ||
1648 | static inline int xhci_register_pci(void) { return 0; } | ||
1649 | static inline void xhci_unregister_pci(void) {} | ||
1647 | #endif | 1650 | #endif |
1648 | 1651 | ||
1649 | /* xHCI host controller glue */ | 1652 | /* xHCI host controller glue */ |