]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: gadget: udc: Fix duplicate uclass name
authorZixun LI <admin@hifiphile.com>
Fri, 2 Aug 2024 09:28:11 +0000 (11:28 +0200)
committerMattijs Korpershoek <mkorpershoek@baylibre.com>
Tue, 20 Aug 2024 07:36:36 +0000 (09:36 +0200)
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" to fix, also makes bind/unbind by class
index (or sequence) working.

This breaks the capacity of using "usb" as DT alias sequence numbering
which needs a fix afterwards.

Signed-off-by: Zixun LI <admin@hifiphile.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/all/20240802092820.917450-1-admin@hifiphile.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
drivers/usb/gadget/udc/udc-uclass.c

index fbe62bbce477fd08c95d187e63f8b19fc7ad3e82..723d1cdfd782de54d1de48b5ffa51134a5d2cc5f 100644 (file)
@@ -83,7 +83,7 @@ __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",
        .flags          = DM_UC_FLAG_SEQ_ALIAS,
 };
 #endif