[openwrt/openwrt] realtek: dsa: drop redundant mac_config() logic
LEDE Commits
lede-commits at lists.infradead.org
Sat Feb 7 15:38:14 PST 2026
hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9d839e6a46e5f58e2e794f054ef0b17a6dad2666
commit 9d839e6a46e5f58e2e794f054ef0b17a6dad2666
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Fri Feb 6 13:30:05 2026 +0100
realtek: dsa: drop redundant mac_config() logic
RTL930x and RTL931x basically share the same logic for mac_config().
No need to duplicate that logic in two functions and to call one
from the other.
Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21895
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
.../files-6.12/drivers/net/dsa/rtl83xx/dsa.c | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
index 311e59e6f8..06334c812a 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
@@ -727,22 +727,6 @@ static void rtldsa_83xx_phylink_mac_config(struct dsa_switch *ds, int port,
sw_w32(mcr, priv->r->mac_force_mode_ctrl(port));
}
-static void rtldsa_931x_phylink_mac_config(struct dsa_switch *ds, int port,
- unsigned int mode,
- const struct phylink_link_state *state)
-{
- struct rtl838x_switch_priv *priv = ds->priv;
- u32 reg;
-
- reg = sw_r32(priv->r->mac_force_mode_ctrl(port));
- pr_info("%s reading FORCE_MODE_CTRL: %08x\n", __func__, reg);
-
- /* Disable MAC completely so PCS can setup the SerDes */
- reg = 0;
-
- sw_w32(reg, priv->r->mac_force_mode_ctrl(port));
-}
-
static void rtldsa_93xx_phylink_mac_config(struct dsa_switch *ds, int port,
unsigned int mode,
const struct phylink_link_state *state)
@@ -753,11 +737,8 @@ static void rtldsa_93xx_phylink_mac_config(struct dsa_switch *ds, int port,
if (port == priv->cpu_port)
return;
- if (priv->family_id == RTL9310_FAMILY_ID)
- return rtldsa_931x_phylink_mac_config(ds, port, mode, state);
-
/* Disable MAC completely */
- sw_w32(0, RTL930X_MAC_FORCE_MODE_CTRL + 4 * port);
+ sw_w32(0, priv->r->mac_force_mode_ctrl(port));
}
static void rtldsa_83xx_phylink_mac_link_down(struct dsa_switch *ds, int port,
More information about the lede-commits
mailing list