[U-Boot] [PATCH] usb: udc-uclass: Fixed problem when no alias is defined in DT
Vignesh R
vigneshr at ti.com
Tue Feb 26 09:37:12 UTC 2019
Hi Lukasz,
On 24/01/19 8:14 PM, Jean-Jacques Hiblot wrote:
> commit 801f1fa442 "dm: usb: udc: Use SEQ_ALIAS to index the USB gadget
> ports" changed the way the udevice if found. It uses the alias to find
> a udevice for a given USB port number. In the commit log it was stated
> that if no alias is provided, the bind order will be used instead. However
> it doesn't work. Fixing this by adding a call to uclass_get_device() if
> uclass_get_device_by_seq() fails.
>
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
> ---
This fixes DFU gadget failing to find USB device on DRA7xx/AM57xx
platforms. Since, this patch fixes a regression, could this be picked up
for next -rc?
Tested-by: Vignesh R <vigneshr at ti.com>
> drivers/usb/gadget/udc/udc-uclass.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/gadget/udc/udc-uclass.c b/drivers/usb/gadget/udc/udc-uclass.c
> index 8d7864797a..3053ccf7d9 100644
> --- a/drivers/usb/gadget/udc/udc-uclass.c
> +++ b/drivers/usb/gadget/udc/udc-uclass.c
> @@ -23,8 +23,11 @@ int usb_gadget_initialize(int index)
> return 0;
> ret = uclass_get_device_by_seq(UCLASS_USB_GADGET_GENERIC, index, &dev);
> if (!dev || ret) {
> - pr_err("No USB device found\n");
> - return -ENODEV;
> + ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, index, &dev);
> + if (!dev || ret) {
> + pr_err("No USB device found\n");
> + return -ENODEV;
> + }
> }
> dev_array[index] = dev;
> return 0;
>
--
Regards
Vignesh
More information about the U-Boot
mailing list