From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chee, Tien Fong Date: Tue, 23 Jan 2018 04:28:53 +0000 Subject: [U-Boot] [PATCH v6 2/2] common: Generic firmware loader for file system In-Reply-To: <20180122094436.49ed70a9@karo-electronics.de> References: <1514351078-3487-1-git-send-email-tien.fong.chee@intel.com> <1514351078-3487-3-git-send-email-tien.fong.chee@intel.com> <26cd2102-08f4-68ef-a167-e28f549c93a0@denx.de> <1516250032.2704.15.camel@intel.com> <1516605096.3256.7.camel@intel.com> <20180122094436.49ed70a9@karo-electronics.de> Message-ID: <1516681733.2740.0.camel@intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de 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