Message ID | 67c4fd130d34a197660cf0ed321c1323f8901296.1680483896.git.daniel@makrotopia.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2006429vqo; Sun, 2 Apr 2023 18:43:28 -0700 (PDT) X-Google-Smtp-Source: AKy350bO8CGT6OkRRwECiQkkuKVlpiD4yfHBEDhlxd6evyfWNCOKs/4cNpEaebzqm7CpPG7DOKXm X-Received: by 2002:aa7:d052:0:b0:4fb:54b7:50ea with SMTP id n18-20020aa7d052000000b004fb54b750eamr33415665edo.21.1680486208131; Sun, 02 Apr 2023 18:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680486208; cv=none; d=google.com; s=arc-20160816; b=c9z856dC7he2fpUZeK7q4CwRK8z/Kea40IamorCkt89KQw6L9Q9xdhhdgbORQRXf/E po5Ya3cXxNzdonl86MJCTVMwVrBaYKpIq7Z9RZuv5qoCiHcd3ATqVrI8Rv868WSNXy8J JcIwjjKJiOs/9v8BXPpWLHiDf800zHtQPpuTFBD6PMc/eJtTRtZm5/xErp+uEWLgfH1J w3Af+wT4wGwk33AFy6CaWnazXGtmLhJLCOql0skg3Ge7jTCbdaotgtsvdseo876rpD8h c0WaafuERil4l6WvIz0F8FSPyF9rYi6eH8YwaP9X5j/fAFh4MU6GdK8DzxzT+P7N6p5o e70w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=QQVnQF1VcXGIHk/1M3binVwORnBKMH3NndQVA9IsKQ4=; b=SUVKVfBKP5Bk6zkvGUib4GzqCFoXcYvhNmh/AZH6pAhEHKSrdAdheBiXu3KLSKOkXf hDnPE9/XUP4rPh5VBcoxY0pIZOiVCPkeLu3V3I5uSOe3kUnZ26zN6XF1RcXjepsdVrtE La8kKUMeVwaSjuOQZoF/s1V2U3yakNA6ah3LEb2nWSVOhtX6FhgELXtmbFgrEqoYeuBa fFic87/Y+ccpyLqN6Z6CCeF3Nj9rNqs8LxZkFPPoCMQ1K0ATfTHtsXSFoFaGhm/2knFY QOWtDeUiWDOzVNwRKvwW6inc7rTfYf/pUwnDpQAAhaiurh1EnZWdDJo0o55338j8xrm5 mH1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l8-20020aa7c308000000b00501d2eb7d0dsi2601381edq.199.2023.04.02.18.43.02; Sun, 02 Apr 2023 18:43:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230477AbjDCBR2 (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Sun, 2 Apr 2023 21:17:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230379AbjDCBR0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 2 Apr 2023 21:17:26 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC7465BB2; Sun, 2 Apr 2023 18:17:25 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from <daniel@makrotopia.org>) id 1pj8p1-0004fx-1g; Mon, 03 Apr 2023 03:17:23 +0200 Date: Mon, 3 Apr 2023 02:17:19 +0100 From: Daniel Golle <daniel@makrotopia.org> To: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>, Florian Fainelli <f.fainelli@gmail.com>, Vladimir Oltean <olteanv@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Sean Wang <sean.wang@mediatek.com>, Landen Chao <Landen.Chao@mediatek.com>, DENG Qingfang <dqfext@gmail.com>, Philipp Zabel <p.zabel@pengutronix.de>, Russell King <linux@armlinux.org.uk>, =?utf-8?b?QXLEsW7DpyDDnG5hbA==?= <arinc.unal@arinc9.com> Cc: Sam Shih <Sam.Shih@mediatek.com>, Lorenzo Bianconi <lorenzo@kernel.org>, John Crispin <john@phrozen.org>, Felix Fietkau <nbd@nbd.name> Subject: [PATCH net-next v2 01/14] net: dsa: mt7530: make some noise if register read fails Message-ID: <67c4fd130d34a197660cf0ed321c1323f8901296.1680483896.git.daniel@makrotopia.org> References: <cover.1680483895.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <cover.1680483895.git.daniel@makrotopia.org> X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762117506390789364?= X-GMAIL-MSGID: =?utf-8?q?1762117506390789364?= |
Series |
net: dsa: add support for MT7988
|
|
Commit Message
Daniel Golle
April 3, 2023, 1:17 a.m. UTC
Simply returning the negative error value instead of the read value doesn't seem like a good idea. Return 0 instead and add WARN_ON_ONCE(1) so this kind of error will not go unnoticed. Suggested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> --- drivers/net/dsa/mt7530.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index a0d99af897ace..18d4aa6bb9968 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -224,9 +224,10 @@ mt7530_mii_read(struct mt7530_priv *priv, u32 reg) /* MT7530 uses 31 as the pseudo port */ ret = bus->write(bus, 0x1f, 0x1f, page); if (ret < 0) { + WARN_ON_ONCE(1); dev_err(&bus->dev, "failed to read mt7530 register\n"); - return ret; + return 0; } lo = bus->read(bus, 0x1f, r);