]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
USB: HCD: remove logic about which hcd is loaded
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Jan 2026 15:25:40 +0000 (16:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jan 2026 14:59:00 +0000 (15:59 +0100)
It turns out that warning about which USB host controller is loaded
before another one doesn't really matter.  All that really is needed is
the PCI softdep module loading logic, which has been present in the
kernel ever since commit 05c92da0c524 ("usb: ohci/uhci - add soft
dependencies on ehci_pci")

So remove the warning messages, they are not useful, not needed, and
only confuse people.  As can be seen in the discussion at
https://lore.kernel.org/r/20251230080014.3934590-1-chenhuacai@loongson.cn

Cc: Huacai Chen <chenhuacai@loongson.cn>
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Link: https://patch.msgid.link/2026010739-diffuser-shelter-e31c@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hcd.c
drivers/usb/fotg210/fotg210-hcd.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ohci-hcd.c
drivers/usb/host/uhci-hcd.c
include/linux/usb/hcd.h

index 24feb0de1c0060a34674b9b565bdcd45dd75c267..2d99a59d9f3f4bb5191de874aea272bfde39a10e 100644 (file)
 
 /*-------------------------------------------------------------------------*/
 
-/* Keep track of which host controller drivers are loaded */
-unsigned long usb_hcds_loaded;
-EXPORT_SYMBOL_GPL(usb_hcds_loaded);
-
 /* host controllers we manage */
 DEFINE_IDR (usb_bus_idr);
 EXPORT_SYMBOL_GPL (usb_bus_idr);
index 64c4965a160f4713807122dae0440e65f3f2bd4d..fbb5d590eab66f6ea1c123b291759114d24600f5 100644 (file)
@@ -5625,11 +5625,6 @@ int __init fotg210_hcd_init(void)
        if (usb_disabled())
                return -ENODEV;
 
-       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))
-               pr_warn("Warning! fotg210_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\n",
                        hcd_name, sizeof(struct fotg210_qh),
                        sizeof(struct fotg210_qtd),
@@ -5643,5 +5638,4 @@ int __init fotg210_hcd_init(void)
 void __exit fotg210_hcd_cleanup(void)
 {
        debugfs_remove(fotg210_debug_root);
-       clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
 }
index 6d1d190c914d488a0c66dcfc8247d821cc05c46d..3c46bb18c7f3aa91a60f8e7f18f7c96ee018d3dd 100644 (file)
@@ -1354,12 +1354,6 @@ static int __init ehci_hcd_init(void)
        if (usb_disabled())
                return -ENODEV;
 
-       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),
@@ -1390,7 +1384,6 @@ clean0:
        debugfs_remove(ehci_debug_root);
        ehci_debug_root = NULL;
 #endif
-       clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
        return retval;
 }
 module_init(ehci_hcd_init);
@@ -1404,6 +1397,5 @@ static void __exit ehci_hcd_cleanup(void)
 #ifdef CONFIG_DYNAMIC_DEBUG
        debugfs_remove(ehci_debug_root);
 #endif
-       clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
 }
 module_exit(ehci_hcd_cleanup);
index 9c7f3008646ed5eb130b8d035a1ea3da29a42b9d..30840922f7299fd536ba2ed3bbf9375ce04312a9 100644 (file)
@@ -1282,7 +1282,6 @@ static int __init ohci_hcd_mod_init(void)
 
        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);
 
        ohci_debug_root = debugfs_create_dir("ohci", usb_debug_root);
 
@@ -1332,7 +1331,6 @@ static int __init ohci_hcd_mod_init(void)
        debugfs_remove(ohci_debug_root);
        ohci_debug_root = NULL;
 
-       clear_bit(USB_OHCI_LOADED, &usb_hcds_loaded);
        return retval;
 }
 module_init(ohci_hcd_mod_init);
@@ -1352,7 +1350,6 @@ static void __exit ohci_hcd_mod_exit(void)
        ps3_ohci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
 #endif
        debugfs_remove(ohci_debug_root);
-       clear_bit(USB_OHCI_LOADED, &usb_hcds_loaded);
 }
 module_exit(ohci_hcd_mod_exit);
 
index 14e6dfef16c6be51fa2430bb4ce4d77e220af73d..8bb11109b66c03f34ac66c6bc1d70b49cdb5a01d 100644 (file)
@@ -867,8 +867,6 @@ static int __init uhci_hcd_init(void)
        if (usb_disabled())
                return -ENODEV;
 
-       set_bit(USB_UHCI_LOADED, &usb_hcds_loaded);
-
 #ifdef CONFIG_DYNAMIC_DEBUG
        errbuf = kmalloc(ERRBUF_LEN, GFP_KERNEL);
        if (!errbuf)
@@ -912,8 +910,6 @@ up_failed:
 
 errbuf_failed:
 #endif
-
-       clear_bit(USB_UHCI_LOADED, &usb_hcds_loaded);
        return retval;
 }
 
@@ -930,7 +926,6 @@ static void __exit uhci_hcd_cleanup(void)
 #ifdef CONFIG_DYNAMIC_DEBUG
        kfree(errbuf);
 #endif
-       clear_bit(USB_UHCI_LOADED, &usb_hcds_loaded);
 }
 
 module_init(uhci_hcd_init);
index ac95e7c89df58ace92ed4c1b401f72cbc3857d20..181db044c4d2ec9b7612fa144ada65769e9c22d5 100644 (file)
@@ -760,12 +760,6 @@ 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__ */
 
 #endif /* __USB_CORE_HCD_H */