[SPAM] Re: [PATCH] cmd: usb: Prevent reset in usb tree/info command

Simon Glass sjg at chromium.org
Tue Jun 13 22:12:30 CEST 2023


Hi Xavier,

On Tue, 13 Jun 2023 at 17:04, Xavier Drudis Ferran <xdrudis at tinet.cat> wrote:
>
> El Tue, Jun 13, 2023 at 03:58:22PM +0100, Simon Glass deia:
> >
> > Yes that's right. So 'usb info' should ignore UCLASS_BOOTDEV devices.
>
> That's a possibility, yes. It should work until someone adds another
> device there for some other purpose.
>
> > That is better than checking for the NULL pointer.
> >
>
> Why? What's wrong about checking for null ?
> Or maybe checking for both not null and  not UCLASS_BOOTDEV ?
>
> Not that I care too much, just to understand your reasoning.

Well, devices may have something attached there, so it may be
non-NULL, but point to a different struct from the expected one.

>
> Or can we check for recursible devices somehow ?
> Maybe flag them or something ?
>
> Why is better to state all devices are recursible except some UCLASSes
> (meaning they can have stuff that needs listed in usb info - or
> likewise usb tree -) instead of stating that some closed set are
> recursible ?
>

For USB we can have lots of different types of devices as children, so
it would be a pain to enumerate them all. At least that's how I see
it.

Regards,
Simon


More information about the U-Boot mailing list