Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115790
b: refs/heads/master
c: 9beeee6
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Oct 17, 2008
1 parent 5aa2c30 commit 9e6a052
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2b70f07343389cb474235def00b021a645ede916
refs/heads/master: 9beeee6584b9aa4f9192055512411484a2a624df
4 changes: 4 additions & 0 deletions trunk/drivers/usb/core/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@

/*-------------------------------------------------------------------------*/

/* Keep track of which host controller drivers are loaded */
unsigned long usb_hcds_loaded;
EXPORT_SYMBOL_GPL(usb_hcds_loaded);

/* host controllers we manage */
LIST_HEAD (usb_bus_list);
EXPORT_SYMBOL_GPL (usb_bus_list);
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/usb/core/hcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,4 +482,10 @@ static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
*/
extern struct rw_semaphore ehci_cf_port_reset_rwsem;

/* Keep track of which host controller drivers are loaded */
#define USB_UHCI_LOADED 0
#define USB_OHCI_LOADED 1
#define USB_EHCI_LOADED 2
extern unsigned long usb_hcds_loaded;

#endif /* __KERNEL__ */
15 changes: 13 additions & 2 deletions trunk/drivers/usb/host/ehci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1046,15 +1046,23 @@ static int __init ehci_hcd_init(void)
return -ENODEV;

printk(KERN_INFO "%s: " DRIVER_DESC "\n", hcd_name);
set_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
if (test_bit(USB_UHCI_LOADED, &usb_hcds_loaded) ||
test_bit(USB_OHCI_LOADED, &usb_hcds_loaded))
printk(KERN_WARNING "Warning! ehci_hcd should always be loaded"
" before uhci_hcd and ohci_hcd, not after\n");

pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n",
hcd_name,
sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
sizeof(struct ehci_itd), sizeof(struct ehci_sitd));

#ifdef DEBUG
ehci_debug_root = debugfs_create_dir("ehci", NULL);
if (!ehci_debug_root)
return -ENOENT;
if (!ehci_debug_root) {
retval = -ENOENT;
goto err_debug;
}
#endif

#ifdef PLATFORM_DRIVER
Expand Down Expand Up @@ -1102,6 +1110,8 @@ static int __init ehci_hcd_init(void)
debugfs_remove(ehci_debug_root);
ehci_debug_root = NULL;
#endif
err_debug:
clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
return retval;
}
module_init(ehci_hcd_init);
Expand All @@ -1123,6 +1133,7 @@ static void __exit ehci_hcd_cleanup(void)
#ifdef DEBUG
debugfs_remove(ehci_debug_root);
#endif
clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
}
module_exit(ehci_hcd_cleanup);

3 changes: 3 additions & 0 deletions trunk/drivers/usb/host/ohci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@ static int __init ohci_hcd_mod_init(void)
printk(KERN_INFO "%s: " DRIVER_DESC "\n", hcd_name);
pr_debug ("%s: block sizes: ed %Zd td %Zd\n", hcd_name,
sizeof (struct ed), sizeof (struct td));
set_bit(USB_OHCI_LOADED, &usb_hcds_loaded);

#ifdef DEBUG
ohci_debug_root = debugfs_create_dir("ohci", NULL);
Expand Down Expand Up @@ -1181,6 +1182,7 @@ static int __init ohci_hcd_mod_init(void)
error_debug:
#endif

clear_bit(USB_OHCI_LOADED, &usb_hcds_loaded);
return retval;
}
module_init(ohci_hcd_mod_init);
Expand Down Expand Up @@ -1211,6 +1213,7 @@ static void __exit ohci_hcd_mod_exit(void)
#ifdef DEBUG
debugfs_remove(ohci_debug_root);
#endif
clear_bit(USB_OHCI_LOADED, &usb_hcds_loaded);
}
module_exit(ohci_hcd_mod_exit);

3 changes: 3 additions & 0 deletions trunk/drivers/usb/host/uhci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ static int __init uhci_hcd_init(void)

printk(KERN_INFO "uhci_hcd: " DRIVER_DESC "%s\n",
ignore_oc ? ", overcurrent ignored" : "");
set_bit(USB_UHCI_LOADED, &usb_hcds_loaded);

if (DEBUG_CONFIGURED) {
errbuf = kmalloc(ERRBUF_LEN, GFP_KERNEL);
Expand Down Expand Up @@ -987,6 +988,7 @@ static int __init uhci_hcd_init(void)

errbuf_failed:

clear_bit(USB_UHCI_LOADED, &usb_hcds_loaded);
return retval;
}

Expand All @@ -996,6 +998,7 @@ static void __exit uhci_hcd_cleanup(void)
kmem_cache_destroy(uhci_up_cachep);
debugfs_remove(uhci_debugfs_root);
kfree(errbuf);
clear_bit(USB_UHCI_LOADED, &usb_hcds_loaded);
}

module_init(uhci_hcd_init);
Expand Down

0 comments on commit 9e6a052

Please sign in to comment.