Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp531001lqt; Fri, 19 Apr 2024 03:13:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXnmQpV07+7jtBpAehf/0Gt4Uhy12p/ti8hg0JPhQqjnoR9GXJaT/R16t04k6y8LQd5Q53gniNImN1BukCplcU0USeFhZMXtxFM5Qe8Ag== X-Google-Smtp-Source: AGHT+IGE+4Ui5icZ1Lt8tOoMMSgp+agUoM5xVxa3VmgxTC95WGEhlLSZN+FlooLY04YvwBW+Ztsd X-Received: by 2002:a19:6912:0:b0:518:c69b:3a04 with SMTP id e18-20020a196912000000b00518c69b3a04mr1265847lfc.0.1713521580861; Fri, 19 Apr 2024 03:13:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713521580; cv=pass; d=google.com; s=arc-20160816; b=BYMdATyNIuoE+BjA9Ux5cpzxNdjLcaT9riT+jmsaH+xei0a1BEHq/yrgXL9sMu9Nv2 gXAvo8nKZAq3ivQq6WmHLiEpBLYqmiKuvOgbeOGuupCZyVbvL3N0dalGW+gst+Dor3Ec vXCP2atzcTFK81Yk8bg9Gluo8JwJuJhKyt/BkbdPELzLbZPI+DS+MxS+R9pIGRKqqxr6 1hc9Ym4L1lzFSlb3Re2WrE9FQpTsJJ0NjGD6QCPzo9AeJf3cz/Rrt1gaaQNL0mZwprF4 /MkpE4ZzWITYn9aKQ63dRNZ38O8YjcsPSkWjUmy9TXdwpuHv4AjbhipdR6tp7RTgrebq uf9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=FO8PI7ilTq8L72Zl0eVtmTR9U9LzaMvHSsFdOPwS49k=; fh=U0oULSI5toQXwr8Cib1iIAF99txW9ytx8nrc+ZkpqGc=; b=a82kd1woQOCLo18TMgTXm2b1LH9EqflarQDdNehhO51DxQyyR8JmylAnxlfCpOq7LI Qtt2cJ97s5Tt88RtOGeWxWhfvZ9iuMlMjUbocBoeboN4Ix/2hWwK2CvnsCgm7CADMHTv M3exo+YNdeBqvHHXc7XUB1cOq2F5XPMojcb2W7VxzAAiXI84bbSkf25YnIcwqSB8+Dwj itfqGqepI7H4I/122K4MFB0tjnTf+XfN6Du7um19BUhS2glfzIvhGEj7eeAOossRZEKt MDaJNg7V7Gq6tZB90vPqE/x9lpjOHns92Ky42hzbplW+mzWMTGz91CDMLyV4i4PTHIky M9oA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ObIKwWPt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151299-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151299-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c17-20020aa7d611000000b0057003b8a99csi1996626edr.305.2024.04.19.03.13.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 03:13:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151299-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ObIKwWPt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151299-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151299-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 939311F216C9 for ; Fri, 19 Apr 2024 10:13:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D440C12CDBF; Fri, 19 Apr 2024 10:09:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ObIKwWPt" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BE917F7C6; Fri, 19 Apr 2024 10:09:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713521378; cv=none; b=g2ttYolzgcYgL65d1mRHYVY7+RnnR2ncDrQ4TAvIKeM+mtOm2K2GiBC2KWbugxh+Wm2vmGZVX2rdp7AgsT1NCp060gXrhcm8D2YSGQ8ZjBeld+mFgffULB0X5sEc0kv4EHOhQraYWFgQy063LnluhcXPgTKCtwEPGtg/py4iZK0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713521378; c=relaxed/simple; bh=A/6I8pJ7fmJZa2NSEfrteMXm9y4a13URFTnLtu4q6Cs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kpB7QM/zyQdVDBV5PT6iM5JJ2uj3q54hUpXQcv5DhnwiaytZ29NKOj0Hp80eTUGu4Iko9SoKf9m/DyiVh52Phi7Voy7PCTekfMGQHPqn4oDHsSAhpVyGHftzRH0TGdnma7bAjGN9syAovUpGry0hn82VxOX3iO22yBmItz0sgbw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ObIKwWPt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id E8994C4AF0E; Fri, 19 Apr 2024 10:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713521378; bh=A/6I8pJ7fmJZa2NSEfrteMXm9y4a13URFTnLtu4q6Cs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ObIKwWPt7llKjt5GGySWvobJqBQSRc+UkgqKI75jxI2LZgRgygtEaPXj7yRhybCvm +WyLso0DvQE5L12dDBwq0y1Jq/MulFFsZ8Z7fMFM1jzrRVSxj+/fL27lEJcOQCBym2 ngxW4jPnzx675858qb2dfWs1dBlcWjqqev5uaTyQQMLBaBUx/sE3HMZiBSiSagXulo 318NM6JTHY+BtJTaPcYUZSpq+Ver0NctBna4FoAsr3sEqco1E88kedM76WcdEXudAi 7kn7j8KM1SKfAp9bIUttUGa9yukvS2m2Q9pTXiLemE8rHDWhuat10GyMvB5FeEuuGr cqCeEY+cB/7vA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB626C4345F; Fri, 19 Apr 2024 10:09:37 +0000 (UTC) From: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL_via_B4_Relay?= Date: Fri, 19 Apr 2024 13:09:31 +0300 Subject: [PATCH net-next 08/13] net: dsa: mt7530: return mt7530_setup_mdio & mt7531_setup_common on error Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240419-for-netnext-mt7530-improvements-4-v1-8-6d852ca79b1d@arinc9.com> References: <20240419-for-netnext-mt7530-improvements-4-v1-0-6d852ca79b1d@arinc9.com> In-Reply-To: <20240419-for-netnext-mt7530-improvements-4-v1-0-6d852ca79b1d@arinc9.com> To: Daniel Golle , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King Cc: Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713521374; l=1000; i=arinc.unal@arinc9.com; s=arinc9-Xeront; h=from:subject:message-id; bh=dhGaiF9+p4oldvBExDhNwz/DfR5nSajm98YgCgzXa+8=; b=2BxAch20eM2c8wvH4hsKCRmrCfJCbUYkFInLzGJsmliu0YwKZHxbIUtyCnjWf3L2zY6HGcE7O lOdPe2ZZRPVDm1XFB0M03gpIYRxE1oIfpmsEqmNnYWIpJzGSVIVGTGJ X-Developer-Key: i=arinc.unal@arinc9.com; a=ed25519; pk=z49tLn29CyiL4uwBTrqH9HO1Wu3sZIuRp4DaLZvtP9M= X-Endpoint-Received: by B4 Relay for arinc.unal@arinc9.com/arinc9-Xeront with auth_id=137 X-Original-From: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= Reply-To: arinc.unal@arinc9.com From: Arınç ÜNAL The mt7530_setup_mdio() and mt7531_setup_common() functions should be checked for errors. Return if the functions return a non-zero value. Signed-off-by: Arınç ÜNAL --- drivers/net/dsa/mt7530.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 83436723cb16..4e9aa78ca3d0 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2667,7 +2667,9 @@ mt7531_setup(struct dsa_switch *ds) 0); } - mt7531_setup_common(ds); + ret = mt7531_setup_common(ds); + if (ret) + return ret; /* Setup VLAN ID 0 for VLAN-unaware bridges */ ret = mt7530_setup_vlan0(priv); @@ -3020,6 +3022,8 @@ mt753x_setup(struct dsa_switch *ds) ret = mt7530_setup_mdio(priv); if (ret && priv->irq) mt7530_free_irq_common(priv); + if (ret) + return ret; /* Initialise the PCS devices */ for (i = 0; i < priv->ds->num_ports; i++) { -- 2.40.1