[U-Boot] [UBOOT] [PATCH] cmd: usb: ignore block devices under mass storage device

Lothar Waßmann LW at KARO-electronics.de
Fri Sep 1 06:30:49 UTC 2017


Hi,

On Thu, 10 Aug 2017 22:53:31 -0700 Suneel Garapati wrote:
> usb tree and info commands may cause crash otherwise
> 
> Signed-off-by: Suneel Garapati <suneelglinux at gmail.com>
> ---
>  cmd/usb.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/cmd/usb.c b/cmd/usb.c
> index 992d414..81e1a7b 100644
> --- a/cmd/usb.c
> +++ b/cmd/usb.c
> @@ -415,7 +415,8 @@ static void usb_show_tree_graph(struct usb_device *dev, char *pre)
>  		udev = dev_get_parent_priv(child);
>  
>  		/* Ignore emulators, we only want real devices */
> -		if (device_get_uclass_id(child) != UCLASS_USB_EMUL) {
> +		if (device_get_uclass_id(child) !=
> +		    (UCLASS_USB_EMUL | UCLASS_BLK)) {
>
This should most probably be:
> +		if ((device_get_uclass_id(child) != UCLASS_USB_EMUL) &&
			(device_get_uclass_id(child) != UCLASS_BLK)) {


Lothar Waßmann


More information about the U-Boot mailing list