[U-Boot] [PATCH v6 2/2] common: Generic firmware loader for file system
Chee, Tien Fong
tien.fong.chee at intel.com
Tue Jan 23 04:28:53 UTC 2018
On Mon, 2018-01-22 at 09:44 +0100, Lothar Waßmann wrote:
> Hi,
>
> On Mon, 22 Jan 2018 07:11:37 +0000 Chee, Tien Fong wrote:
> >
> > On Thu, 2018-01-18 at 12:12 +0100, Marek Vasut wrote:
> > >
> > > On 01/18/2018 05:33 AM, Chee, Tien Fong wrote:
> > > >
> > > >
> > > > On Tue, 2018-01-16 at 15:41 +0100, Marek Vasut wrote:
> > > > >
> > > > >
> > > > > On 12/27/2017 06:04 AM, tien.fong.chee at intel.com wrote:
> > > > >
> > > > > Whoa, this improved substantially since last time I checked.
> > > > > Minor
> > > > > nitpicks below.
> > > > >
> > > > > [...]
> > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > +/* USB build is not supported yet in SPL */
> > > > > > +#ifndef CONFIG_SPL_BUILD
> > > > > > +#ifdef CONFIG_USB_STORAGE
> > > > > > +static int init_usb(void)
> > > > > > +{
> > > > > > + int err;
> > > > > > +
> > > > > > + err = usb_init();
> > > > > > + if (err)
> > > > > > + return err;
> > > > > > +
> > > > > > +#ifndef CONFIG_DM_USB
> > > > > > + err = usb_stor_scan(1) < 0 ? -ENODEV : 0;
> > > > > if (err)
> > > > > return err;
> > > > > ?
> > > > >
> > > > This is last line code of the function, so it's always return
> > > > the
> > > > result regardless error or not.
> > > You are rewriting the true error code with -ENODEV instead of
> > > propagating it.
> > >
> > Ohh....are you saying to change the codes as shown in below:
> >
> > err = usb_stor_scan(1);
> > if (err)
> > return err;
> >
> usb_stor_scan() does not return a sensible error code, but '-1' if no
> device was found. This should be changed to -ENODEV then!
>
Okay, so this should be fixed in usb_stor_scan() function.
>
> Lothar Waßmann
More information about the U-Boot
mailing list