From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 2 Apr 2015 19:12:17 +0200 Subject: [U-Boot] [PATCH v2 1/3] usb: usb_new_device return codes consistency In-Reply-To: <1427722589.2521.10.camel@collins> References: <1427624899-9537-1-git-send-email-contact@paulk.fr> <20150330100607.52fd98c8@amdc2363> <1427722589.2521.10.camel@collins> Message-ID: <201504021912.17738.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Monday, March 30, 2015 at 03:36:29 PM, Paul Kocialkowski wrote: > Le lundi 30 mars 2015 ? 10:06 +0200, Lukasz Majewski a ?crit : > > Hi Paul, > > > > > Signed-off-by: Paul Kocialkowski > > > --- > > > > > > common/usb.c | 8 ++++---- > > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > > > diff --git a/common/usb.c b/common/usb.c > > > index 32e15cd..ea5b406 100644 > > > --- a/common/usb.c > > > +++ b/common/usb.c > > > @@ -915,7 +915,7 @@ int usb_new_device(struct usb_device *dev) > > > > > > if (err < 8) { > > > > > > printf("\n USB device not responding, " \ > > > > > > "giving up (status=%lX)\n", dev->status); > > > > > > - return 1; > > > + return -1; > > > > If you are going to provide consistency with error codes, then I think > > that it would be beneficial to return -Exxx codes (like -EINVAL, etc). > > That makes sense, I'll give it a try soon (I'm not sure I'll get all the > appropriate error codes right at first try though). I agree, using proper errno is a step in the right direction. Thanks! Best regards, Marek Vasut