From: arinc9.unal@gmail.com
To: "Sean Wang" <sean.wang@mediatek.com>,
"Landen Chao" <Landen.Chao@mediatek.com>,
"DENG Qingfang" <dqfext@gmail.com>,
"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>,
"Russell King" <linux@armlinux.org.uk>,
"René van Dorst" <opensource@vdorst.com>
Cc: "Landen Chao" <landen.chao@mediatek.com>,
"Ilya Lipnitskiy" <ilya.lipnitskiy@gmail.com>,
"Arınç ÜNAL" <arinc.unal@arinc9.com>,
netdev@vger.kernel.org, "Richard van Schagen" <vschagen@cs.com>,
linux-kernel@vger.kernel.org,
"Richard van Schagen" <richard@routerhints.com>,
"Russell King" <rmk+kernel@armlinux.org.uk>,
linux-mediatek@lists.infradead.org, erkin.bozoglu@xeront.com,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH net 3/7] net: dsa: mt7530: do not run mt7530_setup_port5() if port 5 is disabled
Date: Sun, 26 Mar 2023 17:08:14 +0300 [thread overview]
Message-ID: <20230326140818.246575-4-arinc.unal@arinc9.com> (raw)
In-Reply-To: <20230326140818.246575-1-arinc.unal@arinc9.com>
From: Arınç ÜNAL <arinc.unal@arinc9.com>
There's no need to run all the code on mt7530_setup_port5() if port 5 is
disabled. Run mt7530_setup_port5() if priv->p5_intf_sel is not P5_DISABLED
and remove the P5_DISABLED case from mt7530_setup_port5().
Stop initialising the interface variable as the remaining cases will always
call mt7530_setup_port5() with it initialised.
Fixes: 38f790a80560 ("net: dsa: mt7530: Add support for port 5")
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
---
drivers/net/dsa/mt7530.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index eba356249ada..6d33c1050458 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -949,9 +949,6 @@ static void mt7530_setup_port5(struct dsa_switch *ds, phy_interface_t interface)
/* MT7530_P5_MODE_GMAC: P5 -> External phy or 2nd GMAC */
val &= ~MHWTRAP_P5_DIS;
break;
- case P5_DISABLED:
- interface = PHY_INTERFACE_MODE_NA;
- break;
default:
dev_err(ds->dev, "Unsupported p5_intf_sel %d\n",
priv->p5_intf_sel);
@@ -2257,7 +2254,6 @@ mt7530_setup(struct dsa_switch *ds)
* Determine if phy muxing is defined and which phy to mux.
*/
priv->p5_intf_sel = P5_DISABLED;
- interface = PHY_INTERFACE_MODE_NA;
for_each_child_of_node(dn, mac_np) {
if (!of_device_is_compatible(mac_np,
@@ -2290,7 +2286,8 @@ mt7530_setup(struct dsa_switch *ds)
break;
}
- mt7530_setup_port5(ds, interface);
+ if (priv->p5_intf_sel != P5_DISABLED)
+ mt7530_setup_port5(ds, interface);
}
#ifdef CONFIG_GPIOLIB
--
2.37.2
next prev parent reply other threads:[~2023-03-26 14:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-26 14:08 [PATCH 0/7] net: dsa: mt7530: fix port 5 phylink, phy muxing, and port 6 arinc9.unal
2023-03-26 14:08 ` [PATCH net 1/7] net: dsa: mt7530: fix comments regarding port 5 and 6 for both switches arinc9.unal
2023-03-26 14:08 ` [PATCH net 2/7] net: dsa: mt7530: fix phylink for port 5 and fix port 5 modes arinc9.unal
2023-03-27 18:49 ` Vladimir Oltean
2023-03-27 21:44 ` Arınç ÜNAL
2023-03-26 14:08 ` arinc9.unal [this message]
2023-03-27 18:56 ` [PATCH net 3/7] net: dsa: mt7530: do not run mt7530_setup_port5() if port 5 is disabled Vladimir Oltean
2023-03-27 21:46 ` Arınç ÜNAL
2023-03-26 14:08 ` [PATCH net 4/7] net: dsa: mt7530: set both CPU port interfaces to PHY_INTERFACE_MODE_NA arinc9.unal
2023-03-27 19:12 ` Vladimir Oltean
2023-03-27 21:57 ` Arınç ÜNAL
2023-03-28 2:03 ` Jakub Kicinski
2023-03-28 11:20 ` Vladimir Oltean
2023-03-28 21:26 ` Arınç ÜNAL
2023-03-26 14:08 ` [PATCH net 5/7] net: dsa: mt7530: set up port 5 before CPU ports are enabled arinc9.unal
2023-03-26 14:08 ` [PATCH net 6/7] net: dsa: mt7530: call port 6 setup from mt7530_mac_config() arinc9.unal
2023-03-26 14:08 ` [PATCH net 7/7] net: dsa: mt7530: remove pad_setup function pointer arinc9.unal
2023-03-28 11:21 ` [PATCH 0/7] net: dsa: mt7530: fix port 5 phylink, phy muxing, and port 6 Vladimir Oltean
2023-03-28 21:27 ` Arınç ÜNAL
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230326140818.246575-4-arinc.unal@arinc9.com \
--to=arinc9.unal@gmail.com \
--cc=Landen.Chao@mediatek.com \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=arinc.unal@arinc9.com \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=edumazet@google.com \
--cc=erkin.bozoglu@xeront.com \
--cc=f.fainelli@gmail.com \
--cc=ilya.lipnitskiy@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=opensource@vdorst.com \
--cc=pabeni@redhat.com \
--cc=richard@routerhints.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=sean.wang@mediatek.com \
--cc=vschagen@cs.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox