[RFC PATCH 4/4] usb: gadget: udc: Fix duplicate uclass name

Zixun LI admin at hifiphile.com
Wed Jul 31 15:42:19 CEST 2024


Currently both USB host uclass and USB gadget uclass are using the same
name "usb" which break uclass functions like uclass_get_by_name().

Rename the uclass to "usb_gadget" while using "usb" as sequence alias
naming to keep the alias function working.

Signed-off-by: Zixun LI <admin at hifiphile.com>
---
 drivers/usb/gadget/udc/udc-uclass.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/udc-uclass.c b/drivers/usb/gadget/udc/udc-uclass.c
index fbe62bbce4..b14f84e818 100644
--- a/drivers/usb/gadget/udc/udc-uclass.c
+++ b/drivers/usb/gadget/udc/udc-uclass.c
@@ -83,7 +83,8 @@ __weak int dm_usb_gadget_handle_interrupts(struct udevice *dev)
 #if CONFIG_IS_ENABLED(DM)
 UCLASS_DRIVER(usb_gadget_generic) = {
 	.id		= UCLASS_USB_GADGET_GENERIC,
-	.name		= "usb",
+	.name		= "usb_gadget",
+	.name_seq_alias = "usb",
 	.flags		= DM_UC_FLAG_SEQ_ALIAS,
 };
 #endif
-- 
2.45.2



More information about the U-Boot mailing list