Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3899160rwl; Sun, 2 Apr 2023 18:17:59 -0700 (PDT) X-Google-Smtp-Source: AK7set/IyD7LGjh6DPivxGDHbAj54Qj0UQ9A8h3aNAVCM4GkdGcWYCjGEPfxeib/xVtwxrqYdyLu X-Received: by 2002:a05:6a20:1aa1:b0:d9:11d2:383f with SMTP id ci33-20020a056a201aa100b000d911d2383fmr26611582pzb.53.1680484679475; Sun, 02 Apr 2023 18:17:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680484679; cv=none; d=google.com; s=arc-20160816; b=Eq0qs+lp9mvZ2kuYAsgiT/kCvtUH7LBsMYMCdptP8Mtw+5sDvaXO+7CzBIyyr9PZPF cfJdkUixWcRICqAouPuztTRP0C7FMqErCULZ8547ZM7G/t1cTRo4FR3Lh0POuX5cKJ7A LCpcI0gIemhYuuWNLPMh7jyVpzJFg14KHxc4FsvGVLjJ/5ApjspRt78CQ1q0tv7j+1P4 Ybsfm4Q72E2ugMjEw3O6BWp56avdSfjMv1qw3jQAEghmmqbBHawMCR4QXe6yxzLUwS2K 61QcxR1eHZNth3RRKQ+C36SwDYoOQNXuc4NIYIg0H7QvDg3dxQyw/nUALi8SjcEVRVM3 aA+Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m10-20020a65564a000000b004fbbbc81456si6888144pgs.293.2023.04.02.18.17.48; Sun, 02 Apr 2023 18:17:59 -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 S230420AbjDCBR2 (ORCPT + 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 ); 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 ) id 1pj8p1-0004fx-1g; Mon, 03 Apr 2023 03:17:23 +0200 Date: Mon, 3 Apr 2023 02:17:19 +0100 From: Daniel Golle To: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Sean Wang , Landen Chao , DENG Qingfang , Philipp Zabel , Russell King , =?utf-8?B?QXLEsW7DpyDDnG5hbA==?= Cc: Sam Shih , Lorenzo Bianconi , John Crispin , Felix Fietkau 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: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Daniel Golle Reviewed-by: Andrew Lunn --- 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); -- 2.40.0