From patchwork Sun Mar 29 10:28:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 455742 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id DA0061400B6 for ; Sun, 29 Mar 2015 21:28:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 471014B6BD; Sun, 29 Mar 2015 12:28:41 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qPgSnR5spyOy; Sun, 29 Mar 2015 12:28:41 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AB3AE4A044; Sun, 29 Mar 2015 12:28:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4A4094A044 for ; Sun, 29 Mar 2015 12:28:38 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pet6GQ0mCH5S for ; Sun, 29 Mar 2015 12:28:38 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from gagarine.paulk.fr (gagarine.paulk.fr [109.190.93.129]) by theia.denx.de (Postfix) with ESMTPS id 067DB4A03C for ; Sun, 29 Mar 2015 12:28:34 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 65534) id 3B0BE2040A; Sun, 29 Mar 2015 12:28:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on gagarine.paulk.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from armstrong.paulk.fr (armstrong.paulk.fr [82.233.88.171]) by gagarine.paulk.fr (Postfix) with ESMTPS id 7E376203E2; Sun, 29 Mar 2015 12:28:30 +0200 (CEST) Received: from localhost.localdomain (aldrin [192.168.0.128]) by armstrong.paulk.fr (Postfix) with ESMTP id 1B0413762D; Sun, 29 Mar 2015 12:28:27 +0200 (CEST) From: Paul Kocialkowski To: u-boot@lists.denx.de Date: Sun, 29 Mar 2015 12:28:17 +0200 Message-Id: <1427624899-9537-1-git-send-email-contact@paulk.fr> X-Mailer: git-send-email 1.9.1 Cc: Marek Vasut , Tom Rini Subject: [U-Boot] [PATCH v2 1/3] usb: usb_new_device return codes consistency X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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; } memcpy(&dev->descriptor, tmpbuf, 8); #else @@ -952,7 +952,7 @@ int usb_new_device(struct usb_device *dev) err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, 64); if (err < 0) { debug("usb_new_device: usb_get_descriptor() failed\n"); - return 1; + return -1; } dev->descriptor.bMaxPacketSize0 = desc->bMaxPacketSize0; @@ -968,7 +968,7 @@ int usb_new_device(struct usb_device *dev) err = hub_port_reset(dev->parent, dev->portnr - 1, &portstatus); if (err < 0) { printf("\n Couldn't reset port %i\n", dev->portnr); - return 1; + return -1; } } else { usb_reset_root_port(); @@ -1014,7 +1014,7 @@ int usb_new_device(struct usb_device *dev) else printf("USB device descriptor short read " \ "(expected %i, got %i)\n", tmp, err); - return 1; + return -1; } memcpy(&dev->descriptor, tmpbuf, sizeof(dev->descriptor)); /* correct le values */