Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp531167lqt; Fri, 19 Apr 2024 03:13:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqzeU8J3iHts22bZujbFx85W8OMVPftEU4B8ZfIb57ovg1ut0Zrub63d5AFQuO7HCgEchXN9+LGWj2TguFcPsFVwmPcrmmGWrHf95D8A== X-Google-Smtp-Source: AGHT+IHLXsxgG+0brx5XSHb+56uB5h5cKDIrgIGl/briV1+zjo+u+HkHFTprjjB5liS/vUB2Kz1o X-Received: by 2002:a50:c041:0:b0:570:392:aa1a with SMTP id u1-20020a50c041000000b005700392aa1amr1900425edd.7.1713521600932; Fri, 19 Apr 2024 03:13:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713521600; cv=pass; d=google.com; s=arc-20160816; b=jWWghUjsrifsqCavdZcuXbhleI5Y6Yrjmj9DQ7GA5zHfmacBmoE7ceFEu9hwLWt76j 6YQSsrnGOGAlmh/QAnzzTcKffSf7aEN0jyXcnT00uSoMy9n+3/FoV0AVpxZ66YqImxP6 jVdcHH+JZir5SWaLJfQcA2U0Mr7wmRvRlvm0PlAVzDiOMS3kWfmkXU2LFvuVfB9DNIml OmVBzsQnpFw+L5dvAuGXgseos7TOZ4+HzqTmxmV4fTPi5yWgXUESzWznB0dmWj+tGeMz 75dLze0RDhTpjPL4TrLqLwiNu77bjVWby4LNB852X8EzvNbdCPblk30nMPPzCbOErDgb GXuw== 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=DUMBzcGBEpchcJvvWVkliLA2E/rXgiuXkSp+lcXHBHE=; fh=U0oULSI5toQXwr8Cib1iIAF99txW9ytx8nrc+ZkpqGc=; b=z2pW/DHaZ3CKk+Jn+M2IviV1xOa4a2U4or4Fx3RCI/8Ki+h94sd5L2lvUN198ss57m eqic5YzXPvM81G29gWyY4lf1nmvAyhisafAvY7tFbs6/0br/7b4Dgom3I/C1kt2eFrIi 2EHUz9yP0NNaC879yW+cLYTdG5gbsLec/Nl++Me/Vc/q0vobU+vmnh72i6d1Hw8zceFy 1qygNMK8+NJ9LEQw/CiKUHl6s7YZ2uSNCcM/TV3bNsrFeniXdyoFqkX4vJYpBY9yRaXQ ZSx74WhvQ4n6dxavyXEf53sHHUkvZ/VQCbeGmGXb5rtBrY++17LiyC2i0PwFLSadoRNZ PmPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ahWAMSh/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151302-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151302-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 t5-20020a508d45000000b00571d728e836si312927edt.519.2024.04.19.03.13.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 03:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151302-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="ahWAMSh/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151302-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151302-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 A7DCC1F2249C for ; Fri, 19 Apr 2024 10:13:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8925312DDA7; Fri, 19 Apr 2024 10:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ahWAMSh/" 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 6FAC17F7F1; 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=cAgtN0P3N4M5DbWBggfNn3kn1mk4Q6JL6M6Kw+vcNAE9TeD+3oRGjuzZMKcOfHVuV9s7t31N9hFDpl2TrHGb0NKZdoDDeGQh1EQzB4xr2OFSPa6tX4amhAUBoi0zlF/BX+ZMPtXroc7tEc+5jtoPeLCjr7PhJ7JZur0l+ZkIrz0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713521378; c=relaxed/simple; bh=ZNmSMiuq5wJcBo+EGlGmT/XTyYTDOnZPeAOljaVsq+M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s6vqrQt5PdQ4QE9CY2MdKUuznzaLGleriHb/+B/dJICoIf+u+/zGDk5/uTpUNwrvDxRUEpLOfrygS4AM7YcmZ/fk9kAvxlnR+iAX+ivxhSxiGH76ji6PQrUICCHaoYo9owAUdSlbr8woPpHa1QZMMUhPqa+sAVXMs6hhmbqWHdk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ahWAMSh/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 4E92EC4AF07; Fri, 19 Apr 2024 10:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713521378; bh=ZNmSMiuq5wJcBo+EGlGmT/XTyYTDOnZPeAOljaVsq+M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ahWAMSh/qjA1VIw8T6MFh+en9clMxEU4B3qAfiuR2mUjkKQfoMNKAeS4jvftgLEb5 qSSqgstFp5gDWye9zhwtttDwbRBbFFCZTuMKcUN0XT1BcODl1O4Ms//4qlxOoknNkC YvF7aBqO6o8is/XYHxfDrrPn/rxFytIAZqoC34XtCwUFMjG4lIxdeGIEIDa15E9xY8 c8RF8sN9XDL6XPF6GKvqK84TD4Mz5LR7X2k+rXSFlW3nrvv2WB/VsnABFnK5MMKv/q 5p9fXZ2OPAziuJkCdUez0XshHVOOmb/8S+YTB+hlNC/CfQ6Pab8fXzMa3R3/Oathp9 LQQ+RssYPl26Q== 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 4644AC04FF6; Fri, 19 Apr 2024 10:09:38 +0000 (UTC) From: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL_via_B4_Relay?= Date: Fri, 19 Apr 2024 13:09:36 +0300 Subject: [PATCH net-next 13/13] net: dsa: mt7530: use priv->ds->num_ports instead of MT7530_NUM_PORTS 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-13-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=1820; i=arinc.unal@arinc9.com; s=arinc9-Xeront; h=from:subject:message-id; bh=zwYuUUVIbXmvRXAn0iA1vobSjJIppJvvXAmZxGXeCM8=; b=fe6mJg0I8EYeeDH1SRaOoku+kWHl7bJSQMptDTwIIsKsJjM2Ye2E/BZe2PgrQWFS3Q+DLWrY6 M/7B5bZqr4yBBq/kg9oZ6WE/NN10dRp5OB3IueAP5ByiUJ0dMCiYOS+ 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 Signed-off-by: Arınç ÜNAL --- drivers/net/dsa/mt7530.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 5e69ff0a4b24..55954a165a15 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -1411,7 +1411,7 @@ mt7530_port_set_vlan_unaware(struct dsa_switch *ds, int port) mt7530_rmw(priv, MT7530_PPBV1_P(port), G0_PORT_VID_MASK, G0_PORT_VID_DEF); - for (i = 0; i < MT7530_NUM_PORTS; i++) { + for (i = 0; i < priv->ds->num_ports; i++) { if (dsa_is_user_port(ds, i) && dsa_port_is_vlan_filtering(dsa_to_port(ds, i))) { all_user_ports_removed = false; @@ -2428,7 +2428,7 @@ mt7530_setup(struct dsa_switch *ds) /* Enable and reset MIB counters */ mt7530_mib_reset(ds); - for (i = 0; i < MT7530_NUM_PORTS; i++) { + for (i = 0; i < priv->ds->num_ports; i++) { /* Clear link settings and enable force mode to force link down * on all ports until they're enabled later. */ @@ -2539,7 +2539,7 @@ mt7531_setup_common(struct dsa_switch *ds) mt7530_clear(priv, MT753X_MFC, BC_FFP_MASK | UNM_FFP_MASK | UNU_FFP_MASK); - for (i = 0; i < MT7530_NUM_PORTS; i++) { + for (i = 0; i < priv->ds->num_ports; i++) { /* Clear link settings and enable force mode to force link down * on all ports until they're enabled later. */ @@ -2626,7 +2626,7 @@ mt7531_setup(struct dsa_switch *ds) priv->p5_sgmii = !!(val & PAD_DUAL_SGMII_EN); /* Force link down on all ports before internal reset */ - for (i = 0; i < MT7530_NUM_PORTS; i++) + for (i = 0; i < priv->ds->num_ports; i++) mt7530_write(priv, MT753X_PMCR_P(i), MT7531_FORCE_MODE_LNK); /* Reset the switch through internal reset */ -- 2.40.1