aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r--drivers/usb/host/ehci-hcd.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 5f2d74ed5ad7..264182654f4c 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -33,6 +33,7 @@
33#include <linux/usb.h> 33#include <linux/usb.h>
34#include <linux/moduleparam.h> 34#include <linux/moduleparam.h>
35#include <linux/dma-mapping.h> 35#include <linux/dma-mapping.h>
36#include <linux/debugfs.h>
36 37
37#include "../core/hcd.h" 38#include "../core/hcd.h"
38 39
@@ -978,15 +979,30 @@ static int __init ehci_hcd_init(void)
978 sizeof(struct ehci_qh), sizeof(struct ehci_qtd), 979 sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
979 sizeof(struct ehci_itd), sizeof(struct ehci_sitd)); 980 sizeof(struct ehci_itd), sizeof(struct ehci_sitd));
980 981
982#ifdef DEBUG
983 ehci_debug_root = debugfs_create_dir("ehci", NULL);
984 if (!ehci_debug_root)
985 return -ENOENT;
986#endif
987
981#ifdef PLATFORM_DRIVER 988#ifdef PLATFORM_DRIVER
982 retval = platform_driver_register(&PLATFORM_DRIVER); 989 retval = platform_driver_register(&PLATFORM_DRIVER);
983 if (retval < 0) 990 if (retval < 0) {
991#ifdef DEBUG
992 debugfs_remove(ehci_debug_root);
993 ehci_debug_root = NULL;
994#endif
984 return retval; 995 return retval;
996 }
985#endif 997#endif
986 998
987#ifdef PCI_DRIVER 999#ifdef PCI_DRIVER
988 retval = pci_register_driver(&PCI_DRIVER); 1000 retval = pci_register_driver(&PCI_DRIVER);
989 if (retval < 0) { 1001 if (retval < 0) {
1002#ifdef DEBUG
1003 debugfs_remove(ehci_debug_root);
1004 ehci_debug_root = NULL;
1005#endif
990#ifdef PLATFORM_DRIVER 1006#ifdef PLATFORM_DRIVER
991 platform_driver_unregister(&PLATFORM_DRIVER); 1007 platform_driver_unregister(&PLATFORM_DRIVER);
992#endif 1008#endif
@@ -997,6 +1013,10 @@ static int __init ehci_hcd_init(void)
997#ifdef PS3_SYSTEM_BUS_DRIVER 1013#ifdef PS3_SYSTEM_BUS_DRIVER
998 retval = ps3_ehci_driver_register(&PS3_SYSTEM_BUS_DRIVER); 1014 retval = ps3_ehci_driver_register(&PS3_SYSTEM_BUS_DRIVER);
999 if (retval < 0) { 1015 if (retval < 0) {
1016#ifdef DEBUG
1017 debugfs_remove(ehci_debug_root);
1018 ehci_debug_root = NULL;
1019#endif
1000#ifdef PLATFORM_DRIVER 1020#ifdef PLATFORM_DRIVER
1001 platform_driver_unregister(&PLATFORM_DRIVER); 1021 platform_driver_unregister(&PLATFORM_DRIVER);
1002#endif 1022#endif
@@ -1022,6 +1042,9 @@ static void __exit ehci_hcd_cleanup(void)
1022#ifdef PS3_SYSTEM_BUS_DRIVER 1042#ifdef PS3_SYSTEM_BUS_DRIVER
1023 ps3_ehci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER); 1043 ps3_ehci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
1024#endif 1044#endif
1045#ifdef DEBUG
1046 debugfs_remove(ehci_debug_root);
1047#endif
1025} 1048}
1026module_exit(ehci_hcd_cleanup); 1049module_exit(ehci_hcd_cleanup);
1027 1050