[U-Boot] [PATCH 1/1] cmd: usb: display bus number

Marek Vasut marex at denx.de
Wed Jan 2 14:21:52 UTC 2019


On 1/2/19 12:29 PM, Heinrich Schuchardt wrote:
> If multiple USB buses exist, the output of the commands 'usb tree' and 'usb
> info' is confusing because it is not clear where the output for a new bus
> starts.
> 
> Print an additional line for each bus indicating the bus number, e.g.
> 
> => usb tree
> USB device tree:
> USB bus 0
>   1  Hub (5 Gb/s, 0mA)
>      U-Boot XHCI Host Controller
> 
> USB bus 1
>   1  Hub (5 Gb/s, 0mA)
>      U-Boot XHCI Host Controller
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
>  cmd/usb.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/cmd/usb.c b/cmd/usb.c
> index 0ccb1b5148..6da945c376 100644
> --- a/cmd/usb.c
> +++ b/cmd/usb.c
> @@ -470,6 +470,7 @@ static void usb_for_each_root_dev(usb_dev_func_t func)
>  		if (!device_active(bus))
>  			continue;
>  
> +		printf("USB bus %d\n", bus->seq);

Isn't this only valid if you use SEQ_ALIAS ?

>  		device_find_first_child(bus, &dev);
>  		if (dev && device_active(dev)) {
>  			udev = dev_get_parent_priv(dev);
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list