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

Mattijs Korpershoek mkorpershoek at baylibre.com
Fri Aug 16 17:37:05 CEST 2024


Hi Zixun,

On mar., août 13, 2024 at 15:39, Zixun LI <admin at hifiphile.com> wrote:

> 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.

Thank you for the explanation.
Looking at the code, I don't see anyone calling:
- uclass_find_device_by_seq(UCLASS_USB_GADGET

And one occurrence of:
- uclass_get_device_by_seq(UCLASS_USB_GADGET_GENERIC, index, &dev);

Reviewed-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>

>
> 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