[PATCH] usb: gadget: udc: Fix duplicate uclass name

Zixun LI admin at hifiphile.com
Tue Aug 13 15:39:35 CEST 2024


Hi Mattijs,

On Tue, Aug 13, 2024 at 10:28 AM Mattijs Korpershoek
<mkorpershoek at baylibre.com> wrote:
>
> Thank you for giving some board examples. I am still a bit unclear on
> the meaning of:
>
> """
> This breaks the capacity of using "usb" as DT alias sequence numbering
> which needs a fix afterwards.
> """
>
> I have added Jagan, Stefano, Fabio and the NXP team in CC. Does anyone
> of you have any concerns with this patch ?
>
> If someone could test it, that would be helpful.

The device sequence number is affected by uclass_find_next_free_seq() in
uclass.c, in this function uclass name is used to determine the number.

Since the gadget class's name changed to "usb_gadget" from "usb", alias
binding "usb1 = &usbotg;" is not effective anymore. As now it searches for
"usb_gadget1 = &usbotg;".

uclass_find_device_by_seq(UCLASS_USB_GADGET_GENERIC,) would fail as sequence
number is changed.

I made a tentative fix in
https://lore.kernel.org/u-boot/20240731134257.686017-2-admin@hifiphile.com/
But Simon doesn't want to modify uclass_driver structure only for gadget
class.

Regards,
Zixun


More information about the U-Boot mailing list