From patchwork Sun May 10 12:10:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 470436 X-Patchwork-Delegate: sjg@chromium.org 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 746E91401DA for ; Sun, 10 May 2015 22:11:22 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2ED884B69E; Sun, 10 May 2015 14:11:08 +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 dCcszGBwQ7of; Sun, 10 May 2015 14:11:08 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 337F44B616; Sun, 10 May 2015 14:10:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D65D94B65F for ; Sun, 10 May 2015 14:10:49 +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 WcssgpVQyR00 for ; Sun, 10 May 2015 14:10:49 +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 mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by theia.denx.de (Postfix) with ESMTPS id C2B5F4B657 for ; Sun, 10 May 2015 14:10:44 +0200 (CEST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4ACAZhj015828 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 10 May 2015 08:10:35 -0400 Received: from shalem.localdomain.com (vpn1-5-196.ams2.redhat.com [10.36.5.196]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4ACASp1008549; Sun, 10 May 2015 08:10:34 -0400 From: Hans de Goede To: Simon Glass , Marek Vasut Date: Sun, 10 May 2015 14:10:15 +0200 Message-Id: <1431259827-8109-4-git-send-email-hdegoede@redhat.com> In-Reply-To: <1431259827-8109-1-git-send-email-hdegoede@redhat.com> References: <1431259827-8109-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Cc: u-boot@lists.denx.de, Ian Campbell Subject: [U-Boot] [PATCH v5 03/15] usb: legacy_hub_port_reset() check and propagate usb_set_port_feature() errors 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" Actually check for usb_set_port_feature() errors and propagate these if they happen. Signed-off-by: Hans de Goede Acked-by: Marek Vasut --- common/usb_hub.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/usb_hub.c b/common/usb_hub.c index c9be530..7aac220 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -157,7 +157,7 @@ static inline char *portspeed(int portstatus) int legacy_hub_port_reset(struct usb_device *dev, int port, unsigned short *portstat) { - int tries; + int err, tries; ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1); unsigned short portstatus, portchange; @@ -168,8 +168,10 @@ int legacy_hub_port_reset(struct usb_device *dev, int port, debug("%s: resetting port %d...\n", __func__, port + 1); #endif for (tries = 0; tries < MAX_TRIES; tries++) { + err = usb_set_port_feature(dev, port + 1, USB_PORT_FEAT_RESET); + if (err < 0) + return err; - usb_set_port_feature(dev, port + 1, USB_PORT_FEAT_RESET); mdelay(200); if (usb_get_port_status(dev, port + 1, portsts) < 0) {