[LEDE-DEV] [PATCH] kernel: clean up usb gadget support

Tim Harvey tharvey at gateworks.com
Thu Sep 1 07:52:32 PDT 2016


clean up usb gadget support:
- remove unnecessary kmod-usb-lib-composite
- make kmod-usb-gadget a proper dependency vs a selection
- rename modules so that they match standard linux kernel module name
  and properly indent underneath usb-gadget in menuconfig

Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 package/kernel/linux/modules/usb.mk | 48 +++++++++++++++----------------------
 1 file changed, 19 insertions(+), 29 deletions(-)

diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index 52c28c9..24b5d7b 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -219,20 +219,6 @@ endef
 
 $(eval $(call KernelPackage,usb-gadget))
 
-define KernelPackage/usb-lib-composite
-  TITLE:=USB lib composite
-  KCONFIG:=CONFIG_USB_LIBCOMPOSITE
-  DEPENDS:=+kmod-usb-gadget +kmod-fs-configfs
-  FILES:=$(LINUX_DIR)/drivers/usb/gadget/libcomposite.ko
-  AUTOLOAD:=$(call AutoLoad,50,libcomposite)
-  $(call AddDepends/usb)
-endef
-
-define KernelPackage/usb-lib-composite/description
- Lib Composite
-endef
-
-$(eval $(call KernelPackage,usb-lib-composite))
 
 define KernelPackage/usb-ehci-debug-gadget
   TITLE:=USB EHCI debug port Gadget support
@@ -252,14 +238,15 @@ endef
 
 $(eval $(call KernelPackage,usb-ehci-debug-gadget))
 
-define KernelPackage/usb-eth-gadget
-  TITLE:=USB Ethernet Gadget support
+define KernelPackage/usb-g_ether
+  TITLE:=USB Ethernet Gadget
   KCONFIG:= \
 	CONFIG_USB_ETH \
 	CONFIG_USB_ETH_RNDIS=y \
 	CONFIG_USB_ETH_EEM=n
-  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
+  DEPENDS:=kmod-usb-gadget +kmod-fs-configfs
   FILES:= \
+	$(LINUX_DIR)/drivers/usb/gadget/libcomposite.ko \
 	$(LINUX_DIR)/drivers/usb/gadget/function/u_ether.ko \
 	$(LINUX_DIR)/drivers/usb/gadget/function/usb_f_ecm.ko \
 	$(LINUX_DIR)/drivers/usb/gadget/function/usb_f_ecm_subset.ko \
@@ -269,18 +256,19 @@ define KernelPackage/usb-eth-gadget
   $(call AddDepends/usb)
 endef
 
-define KernelPackage/usb-eth-gadget/description
+define KernelPackage/usb-g_ether/description
  Kernel support for USB Ethernet Gadget
 endef
 
-$(eval $(call KernelPackage,usb-eth-gadget))
+$(eval $(call KernelPackage,usb-g_ether))
 
 
-define KernelPackage/usb-serial-gadget
-  TITLE:=USB Serial Gadget support
+define KernelPackage/usb-g_serial
+  TITLE:=USB Serial Gadget
   KCONFIG:=CONFIG_USB_G_SERIAL
-  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
+  DEPENDS:=kmod-usb-gadget +kmod-fs-configfs
   FILES:= \
+	$(LINUX_DIR)/drivers/usb/gadget/libcomposite.ko \
 	$(LINUX_DIR)/drivers/usb/gadget/function/u_serial.ko \
 	$(LINUX_DIR)/drivers/usb/gadget/function/usb_f_acm.ko \
 	$(LINUX_DIR)/drivers/usb/gadget/function/usb_f_obex.ko \
@@ -290,28 +278,30 @@ define KernelPackage/usb-serial-gadget
   $(call AddDepends/usb)
 endef
 
-define KernelPackage/usb-serial-gadget/description
+define KernelPackage/usb-g_serial/description
   Kernel support for USB Serial Gadget.
 endef
 
-$(eval $(call KernelPackage,usb-serial-gadget))
+$(eval $(call KernelPackage,usb-g_serial))
+
 
-define KernelPackage/usb-mass-storage-gadget
-  TITLE:=USB Mass Storage support
+define KernelPackage/usb-g_mass-storage
+  TITLE:=USB Mass Storage
   KCONFIG:=CONFIG_USB_MASS_STORAGE
-  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
+  DEPENDS:=kmod-usb-gadget +kmod-fs-configfs
   FILES:= \
+	$(LINUX_DIR)/drivers/usb/gadget/libcomposite.ko \
 	$(LINUX_DIR)/drivers/usb/gadget/function/usb_f_mass_storage.ko \
 	$(LINUX_DIR)/drivers/usb/gadget/legacy/g_mass_storage.ko
   AUTOLOAD:=$(call AutoLoad,52,usb_f_mass_storage g_mass_storage)
   $(call AddDepends/usb)
 endef
 
-define KernelPackage/usb-mass-storage-gadget/description
+define KernelPackage/usb-g_mass-storage/description
   Kernel support for USB Gadget Mass Storage
 endef
 
-$(eval $(call KernelPackage,usb-mass-storage-gadget))
+$(eval $(call KernelPackage,usb-g_mass-storage))
 
 
 define KernelPackage/usb-uhci
-- 
1.9.1




More information about the Lede-dev mailing list