[U-Boot] [PATCH v2] usb: host: Print device name when scanning

Marek Vasut marek.vasut at gmail.com
Mon Mar 18 12:35:23 UTC 2019


On 3/18/19 1:31 PM, Ismael Luceno Cortes wrote:
> The name assigned to the USB host controller interface is a better
> indicator than the counter currently in use (which has no meaning other
> than being the order in which the interface is found).
> 
> Example of the original output:
>> USB0:   USB EHCI 1.10
>> scanning bus 0 for devices... 2 USB Device(s) found
>>        scanning usb for storage devices... 1 Storage Device(s) found
> 
> Patched output:
>> USB0(usb at ee080100):   USB EHCI 1.10
>> scanning bus 0 for devices... 2 USB Device(s) found
>>        scanning usb for storage devices... 1 Storage Device(s) found
> 
> Signed-off-by: Ismael Luceno <ismael.luceno at silicon-gears.com>
> ---
> 
> Notes:
>     Changes since v1:
>     - Improved commit message.
> 
>  drivers/usb/host/usb-uclass.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
> index 611ea97a72..0575f5393b 100644
> --- a/drivers/usb/host/usb-uclass.c
> +++ b/drivers/usb/host/usb-uclass.c
> @@ -255,7 +255,7 @@ int usb_init(void)
>  
>  	uclass_foreach_dev(bus, uc) {
>  		/* init low_level USB */
> -		printf("USB%d:   ", count);
> +		printf("USB%d(%s):   ", count, bus->name);
>  		count++;

Hmmm, why dont we just drop the count altogether then ?

The output would then be:

USB %s: USB EHCI...
scanning bus %s for devices...

for %s being the bus->name.

With the improved commit message, this would actually make sense. Does
that make sense to you too or am I missing something ?

>  #ifdef CONFIG_SANDBOX
> 
> base-commit: 9ba5e5bc261a16f51662490da0cf620dc7f29013
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list