Message ID | 20230117205703.25960-4-jerry.ray@microchip.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2033267wrn; Tue, 17 Jan 2023 15:16:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXsPnIviSzKu6DzPp9f/0Qh3wo4Az0tJMS8m07El+N67vxz1ZrucOquBFPYO7XWSynZGMvYe X-Received: by 2002:a05:6402:360d:b0:46c:2c94:d30b with SMTP id el13-20020a056402360d00b0046c2c94d30bmr5467285edb.33.1673997406606; Tue, 17 Jan 2023 15:16:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673997406; cv=none; d=google.com; s=arc-20160816; b=s0SbSjmyICwyv5/lha3uXClqg7VHydOK+Ocs987oaAQc987+mPinHzpCMWd2ZuTjI+ 4JobrL8bg2b9MqhoTlKv1ipLSIx8TVJxBPNDXjYUREnbSbZ1A0ihpwaieUvWMX37CeYn Qlkvg67b3APp1OsBRgdMASHAiseLZaa+DcrdaW/Tx4IDCdFQcPxhrqj3G30tMJQUeTTD pk7tRTZVMhljlGEig7/FQR9wHzQMooK2ePktDBEyNvkUy/aK83Cv4ROrcJxuStWiY+c4 Nu0J7xTYARv1IB6VoPKhVvjm7gNEqXdbSKAlAvd3TU9tkx7I5sgpZQxKCKm9nlFjtFhk o7Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=OMfSSIzPMfz2kmVAxU8owoMF1ejMQVLyY9i+I2rBUZ0=; b=aiXM40SUPrKDBlhop7Bui1XP8QDsVjO+DLcRLCMGaknmfsmsTF9B8kCEg/k/He30Y1 gGRn98XKXKxEajmPjzsAQno3lQCtFjNqyDRnT+mMdoOt5X3PfxyZyF0ZExHdWDEgDoF8 69eEkifa7v6+7smQnDxAlhlbLaaDxi+CoHul0nTCytweAqyy5xX6ettX1wpuRT3as1Hv 2noBTRem1b7SUmmJRHSjTC4SXDK7G3JbH7jnjkPKWLpH49kJ2PwcvgE+t0vVt2ynwmVQ mDtuMQvOcfsgDKUYekJBpeKVfsbSLzj7QuZ/KD8y1JA7DBZwCEsDRlEJk4XNK5Z8hdUy 438A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=j3Z9lxUt; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id en23-20020a056402529700b0049dcfc7afe2si5056545edb.437.2023.01.17.15.16.21; Tue, 17 Jan 2023 15:16:46 -0800 (PST) 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; dkim=pass header.i=@microchip.com header.s=mchp header.b=j3Z9lxUt; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229516AbjAQXOK (ORCPT <rfc822;pfffrao@gmail.com> + 99 others); Tue, 17 Jan 2023 18:14:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbjAQXNQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 17 Jan 2023 18:13:16 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 681D78CE48; Tue, 17 Jan 2023 12:57:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673989037; x=1705525037; h=from:to:subject:date:message-id:in-reply-to:references: mime-version; bh=7EEKO+T/AsKAYllVpBR1IF6jmvpXWkUA9M7SqcfZgMk=; b=j3Z9lxUt3D5xAl2yOg+W+QgzMrNkZQkUXPKpx7ZGvkdIbxsxKx9W2lsz mY30T89yRWtvSC504RE2eORO8KI09le9wTVeQNeeyINWL2URVL1+P134F Fzu2E6dj7YJaoBRp/+9NWXq75zGjWA0KN7BS+E2aj4IDCKjTskFT53O22 W1S2qTGn9pEyp9aYGUN4rDNTgKc0423+PNtYK4v9WQ/Tlu4+ygCejsnvi P8e1nqEHkIo4M7wVEBoAnLi4tDSFOErXUKVz7DL04yL4s/Q2a9ZT/iS96 zZIQggoNjo30QipykZS9tKVd1ipk6ElMY4WDhFcvDr/DM7B7ny99Bcdft A==; X-IronPort-AV: E=Sophos;i="5.97,224,1669100400"; d="scan'208";a="197211172" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Jan 2023 13:57:14 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 17 Jan 2023 13:57:13 -0700 Received: from AUS-LT-C33025.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 17 Jan 2023 13:57:11 -0700 From: Jerry Ray <jerry.ray@microchip.com> To: 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>, Russell King <linux@armlinux.org.uk>, <jbe@pengutronix.de>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Jerry Ray <jerry.ray@microchip.com> Subject: [net-next: PATCH v7 3/7] dsa: lan9303: Add exception logic for read failure Date: Tue, 17 Jan 2023 14:56:59 -0600 Message-ID: <20230117205703.25960-4-jerry.ray@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230117205703.25960-1-jerry.ray@microchip.com> References: <20230117205703.25960-1-jerry.ray@microchip.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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?1755313504366491370?= X-GMAIL-MSGID: =?utf-8?q?1755313504366491370?= |
Series |
dsa: lan9303: Move to PHYLINK
|
|
Commit Message
Jerry Ray
Jan. 17, 2023, 8:56 p.m. UTC
While it is highly unlikely a read will ever fail, This code fragment is
now in a function that allows us to return an error code. A read failure
here will cause the lan9303_probe to fail.
Signed-off-by: Jerry Ray <jerry.ray@microchip.com>
---
drivers/net/dsa/lan9303-core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index 63f5c1ef65e2..66466d50d015 100644 --- a/drivers/net/dsa/lan9303-core.c +++ b/drivers/net/dsa/lan9303-core.c @@ -911,7 +911,9 @@ static int lan9303_setup(struct dsa_switch *ds) } /* Virtual Phy: Remove Turbo 200Mbit mode */ - lan9303_read(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, ®); + ret = lan9303_read(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, ®); + if (ret) + return (ret); reg &= ~LAN9303_VIRT_SPECIAL_TURBO; regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, reg);