[openwrt/openwrt] kernel: usb: add kmod-usb-common package

LEDE Commits lede-commits at lists.infradead.org
Fri Aug 8 09:08:13 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/defce7cefdf3f98d9e48c5422b5f965db4465a19

commit defce7cefdf3f98d9e48c5422b5f965db4465a19
Author: Thomas Richard <thomas.richard at bootlin.com>
AuthorDate: Tue Aug 5 09:32:48 2025 +0200

    kernel: usb: add kmod-usb-common package
    
    Move usb-common driver from usb-core package to a new usb-common package.
    The usb-common driver is needed by usb-gadget driver which can be used
    without host support.
    
    Signed-off-by: Thomas Richard <thomas.richard at bootlin.com>
    Link: https://github.com/openwrt/openwrt/pull/19246
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/linux/modules/usb.mk | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index 4155082901..445a8ff0a1 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -11,15 +11,24 @@ USBNET_DIR:=net/usb
 USBHID_DIR?=hid/usbhid
 USBINPUT_DIR?=input/misc
 
+define KernelPackage/usb-common
+  TITLE:=USB common
+  HIDDEN:=1
+  DEPENDS:=@(USB_SUPPORT||USB_GADGET_SUPPORT)
+  KCONFIG:=CONFIG_USB_COMMON
+  FILES:=$(LINUX_DIR)/drivers/usb/common/usb-common.ko
+  AUTOLOAD:=$(call AutoLoad,20,usb-common,1)
+endef
+
+$(eval $(call KernelPackage,usb-common))
+
 define KernelPackage/usb-core
   SUBMENU:=$(USB_MENU)
   TITLE:=Support for USB
-  DEPENDS:=@USB_SUPPORT
+  DEPENDS:=@USB_SUPPORT +USB_SUPPORT:kmod-usb-common
   KCONFIG:=CONFIG_USB CONFIG_XPS_USB_HCD_XILINX=n CONFIG_USB_FHCI_HCD=n
-  FILES:= \
-	$(LINUX_DIR)/drivers/usb/core/usbcore.ko \
-	$(LINUX_DIR)/drivers/usb/common/usb-common.ko
-  AUTOLOAD:=$(call AutoLoad,20,usb-common usbcore,1)
+  FILES:=$(LINUX_DIR)/drivers/usb/core/usbcore.ko
+  AUTOLOAD:=$(call AutoLoad,20,usbcore,1)
   $(call AddDepends/nls)
 endef
 




More information about the lede-commits mailing list