From patchwork Wed Jan 26 16:52:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 12725524 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B6F25C2BA4C for ; Wed, 26 Jan 2022 17:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4qicSwABosYhQbKIpYR3xem0uxcFFScThPns/FoRgFM=; b=KU/I+dc4fsYl+9 YTbv24ZDBNtB+9xiMgy5iRAFJvaXP37BpfmQUGjthqn5Ny41sCWwe6YUT812yKU0I5lGKz/UCsAwK 5KrMWE66cJJQCI7TQiewiDCv3MJubjE+LQfEQaZS54NX6NYmaOyj4SvE9hTb2gyMgwRqGfnEewnd3 aLG3YfD8AgrRCvyMT4+B0Ha4FoS7gXNdlgGFevF1oWK6Uj3JMlNYqHDs61v8jqlmIJ/ovOWtUEos9 q562W2WI7jbcfr1IV9SH7iWk6JBnQ6UliymD7+6dtdrxa7ljMAsB3gPjx7vfMyM/NOkaDnlRtbBhR hB6SEFIObbUX56uj3WXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmAK-00D1aW-9i; Wed, 26 Jan 2022 17:33:05 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCleI-00Cp5Y-5f for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 16:59:59 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6042961AB9; Wed, 26 Jan 2022 16:59:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06852C340E7; Wed, 26 Jan 2022 16:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643216396; bh=erkUnUzFbvhJS7cgGj2rH0FT37mFoWDGUog4NFCmXCE=; h=From:To:Cc:Subject:Date:From; b=pVLd3kzSw24G5WC1fXL8IGWEgBYtT4RK9RHXc3ACLHOg+GTYqYIEdwASpHzx+nbnZ feyq9SmGeKn544CDJGgqLQzl9iQg1g7iTfXsYXgXB3+U+hP42I/1QAewIlkmrWsV+O ORPEpsqqx/MW1t7bZZ07vswxRvwXb55f/sAUFTTmuVJmnBGx3oHeAyaQJgRMkSJwhz 0tuOBjrHUqiVnTvtETNvRlsX/o29ZqPzw265GU22G4CpMS1LtwCnxLxvlngI9706XJ RseHThzC5PWpPQgAZoPt3g06ndEpSw36CiY26jwPhp21ANvW94zTECwLhheRlqxv2n UadygWUuR1Gbw== From: Jisheng Zhang To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Maxime Coquelin , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] net: stmmac: dwmac-sun8i: use return val of readl_poll_timeout() Date: Thu, 27 Jan 2022 00:52:15 +0800 Message-Id: <20220126165215.1921-1-jszhang@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_085958_313511_6D613B42 X-CRM114-Status: GOOD ( 11.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When readl_poll_timeout() timeout, we'd better directly use its return value. Before this patch: [ 2.145528] dwmac-sun8i: probe of 4500000.ethernet failed with error -14 After this patch: [ 2.138520] dwmac-sun8i: probe of 4500000.ethernet failed with error -110 Signed-off-by: Jisheng Zhang Acked-by: Jernej Skrabec --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 617d0e4c6495..09644ab0d87a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -756,7 +756,7 @@ static int sun8i_dwmac_reset(struct stmmac_priv *priv) if (err) { dev_err(priv->device, "EMAC reset timeout\n"); - return -EFAULT; + return err; } return 0; }