From patchwork Sat Jul 2 00:45:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 1651409 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LZYKW5YCQz9ryY for ; Sat, 2 Jul 2022 10:46:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 358908447D; Sat, 2 Jul 2022 02:46:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 6F5678448F; Sat, 2 Jul 2022 02:46:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 267F18447A for ; Sat, 2 Jul 2022 02:46:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 87E4111FB; Fri, 1 Jul 2022 17:46:03 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 050FD3F5A1; Fri, 1 Jul 2022 17:46:01 -0700 (PDT) From: Andre Przywara To: Marek Vasut , Tom Rini , Simon Glass Cc: Patrice Chotard , u-boot@lists.denx.de Subject: [PATCH] usb: host: ehci-generic: Fix error check Date: Sat, 2 Jul 2022 01:45:10 +0100 Message-Id: <20220702004510.10147-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Commit 81755b8c20fe ("usb: host: ehci-generic: Make resets and clocks optional") improved the error check to cover the reset property being optional. However this was using the wrong error variable for the check, so would now never fail. Use the correct error variable for checking the result of reset_get_bulk(), to actually report genuine errors. Fixes: 81755b8c20fe ("usb: host: ehci-generic: Make resets and clocks optional") Signed-off-by: Andre Przywara --- Hi, apologies for messing up this simple patch of mine last month. I got confused by the mixed usage of "ret" and "err" in this function. This might endorse some cleanup, but I don't dare to touch this file again, especially not that late in the cycle. Cheers, Andre drivers/usb/host/ehci-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c index 15267e9a05a..75c73bfe4e8 100644 --- a/drivers/usb/host/ehci-generic.c +++ b/drivers/usb/host/ehci-generic.c @@ -81,7 +81,7 @@ static int ehci_usb_probe(struct udevice *dev) } err = reset_get_bulk(dev, &priv->resets); - if (ret && ret != -ENOENT) { + if (err && err != -ENOENT) { dev_err(dev, "Failed to get resets (err=%d)\n", err); goto clk_err; }