diff mbox series

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

Message ID 20190318123126.5714-1-ismael.luceno@silicon-gears.com
State Superseded
Headers show
Series [U-Boot,v2] usb: host: Print device name when scanning | expand

Commit Message

Ismael Luceno Cortes March 18, 2019, 12:31 p.m. UTC
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@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@silicon-gears.com>
---

Notes:
    Changes since v1:
    - Improved commit message.

 drivers/usb/host/usb-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 9ba5e5bc261a16f51662490da0cf620dc7f29013

Comments

Marek Vasut March 18, 2019, 12:35 p.m. UTC | #1
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@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@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
>
diff mbox series

Patch

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++;
 
 #ifdef CONFIG_SANDBOX