aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hcd.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-10-02 11:48:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-17 17:41:03 -0400
commit9beeee6584b9aa4f9192055512411484a2a624df (patch)
tree6eec55264d86791a1d4f61bdb9158cf9c720f7ce /drivers/usb/host/ehci-hcd.c
parent2b70f07343389cb474235def00b021a645ede916 (diff)
USB: EHCI: log a warning if ehci-hcd is not loaded first
This patch (as1139) adds a warning to the system log whenever ehci-hcd is loaded after ohci-hcd or uhci-hcd. Nowadays most distributions are pretty good about not doing this; maybe the warning will help convince anyone still doing it wrong. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> [2.6.27] Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r--drivers/usb/host/ehci-hcd.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index fcbc1f2b2377..358df2a6c396 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1046,6 +1046,12 @@ static int __init ehci_hcd_init(void)
1046 return -ENODEV; 1046 return -ENODEV;
1047 1047
1048 printk(KERN_INFO "%s: " DRIVER_DESC "\n", hcd_name); 1048 printk(KERN_INFO "%s: " DRIVER_DESC "\n", hcd_name);
1049 set_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
1050 if (test_bit(USB_UHCI_LOADED, &usb_hcds_loaded) ||
1051 test_bit(USB_OHCI_LOADED, &usb_hcds_loaded))
1052 printk(KERN_WARNING "Warning! ehci_hcd should always be loaded"
1053 " before uhci_hcd and ohci_hcd, not after\n");
1054
1049 pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n", 1055 pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n",
1050 hcd_name, 1056 hcd_name,
1051 sizeof(struct ehci_qh), sizeof(struct ehci_qtd), 1057 sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
@@ -1053,8 +1059,10 @@ static int __init ehci_hcd_init(void)
1053 1059
1054#ifdef DEBUG 1060#ifdef DEBUG
1055 ehci_debug_root = debugfs_create_dir("ehci", NULL); 1061 ehci_debug_root = debugfs_create_dir("ehci", NULL);
1056 if (!ehci_debug_root) 1062 if (!ehci_debug_root) {
1057 return -ENOENT; 1063 retval = -ENOENT;
1064 goto err_debug;
1065 }
1058#endif 1066#endif
1059 1067
1060#ifdef PLATFORM_DRIVER 1068#ifdef PLATFORM_DRIVER
@@ -1102,6 +1110,8 @@ clean0:
1102 debugfs_remove(ehci_debug_root); 1110 debugfs_remove(ehci_debug_root);
1103 ehci_debug_root = NULL; 1111 ehci_debug_root = NULL;
1104#endif 1112#endif
1113err_debug:
1114 clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
1105 return retval; 1115 return retval;
1106} 1116}
1107module_init(ehci_hcd_init); 1117module_init(ehci_hcd_init);
@@ -1123,6 +1133,7 @@ static void __exit ehci_hcd_cleanup(void)
1123#ifdef DEBUG 1133#ifdef DEBUG
1124 debugfs_remove(ehci_debug_root); 1134 debugfs_remove(ehci_debug_root);
1125#endif 1135#endif
1136 clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
1126} 1137}
1127module_exit(ehci_hcd_cleanup); 1138module_exit(ehci_hcd_cleanup);
1128 1139