diff options
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 79f2d8b9bfb..7d7c97cf9b2 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -889,19 +889,59 @@ MODULE_LICENSE ("GPL"); | |||
889 | 889 | ||
890 | #ifdef CONFIG_PCI | 890 | #ifdef CONFIG_PCI |
891 | #include "ehci-pci.c" | 891 | #include "ehci-pci.c" |
892 | #define EHCI_BUS_GLUED | 892 | #define PCI_DRIVER ehci_pci_driver |
893 | #endif | 893 | #endif |
894 | 894 | ||
895 | #ifdef CONFIG_PPC_83xx | 895 | #ifdef CONFIG_PPC_83xx |
896 | #include "ehci-fsl.c" | 896 | #include "ehci-fsl.c" |
897 | #define EHCI_BUS_GLUED | 897 | #define PLATFORM_DRIVER ehci_fsl_driver |
898 | #endif | 898 | #endif |
899 | 899 | ||
900 | #ifdef CONFIG_SOC_AU1X00 | 900 | #ifdef CONFIG_SOC_AU1X00 |
901 | #include "ehci-au1xxx.c" | 901 | #include "ehci-au1xxx.c" |
902 | #define EHCI_BUS_GLUED | 902 | #define PLATFORM_DRIVER ehci_hcd_au1xxx_driver |
903 | #endif | 903 | #endif |
904 | 904 | ||
905 | #ifndef EHCI_BUS_GLUED | 905 | #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) |
906 | #error "missing bus glue for ehci-hcd" | 906 | #error "missing bus glue for ehci-hcd" |
907 | #endif | 907 | #endif |
908 | |||
909 | static int __init ehci_hcd_init(void) | ||
910 | { | ||
911 | int retval = 0; | ||
912 | |||
913 | pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n", | ||
914 | hcd_name, | ||
915 | sizeof(struct ehci_qh), sizeof(struct ehci_qtd), | ||
916 | sizeof(struct ehci_itd), sizeof(struct ehci_sitd)); | ||
917 | |||
918 | #ifdef PLATFORM_DRIVER | ||
919 | retval = platform_driver_register(&PLATFORM_DRIVER); | ||
920 | if (retval < 0) | ||
921 | return retval; | ||
922 | #endif | ||
923 | |||
924 | #ifdef PCI_DRIVER | ||
925 | retval = pci_register_driver(&PCI_DRIVER); | ||
926 | if (retval < 0) { | ||
927 | #ifdef PLATFORM_DRIVER | ||
928 | platform_driver_unregister(&PLATFORM_DRIVER); | ||
929 | #endif | ||
930 | } | ||
931 | #endif | ||
932 | |||
933 | return retval; | ||
934 | } | ||
935 | module_init(ehci_hcd_init); | ||
936 | |||
937 | static void __exit ehci_hcd_cleanup(void) | ||
938 | { | ||
939 | #ifdef PLATFORM_DRIVER | ||
940 | platform_driver_unregister(&PLATFORM_DRIVER); | ||
941 | #endif | ||
942 | #ifdef PCI_DRIVER | ||
943 | pci_unregister_driver(&PCI_DRIVER); | ||
944 | #endif | ||
945 | } | ||
946 | module_exit(ehci_hcd_cleanup); | ||
947 | |||