[PATCH net-next 1/3] net: dsa: mxl862xx: reject DSA_PORT_TYPE_DSA
From: Daniel Golle
Date: Tue Apr 07 2026 - 13:30:55 EST
DSA links aren't supported by the mxl862xx driver.
Instead of returning early from .port_setup when called for
DSA_PORT_TYPE_DSA ports rather return -EOPNOTSUPP and show an error
message.
The desired side-effect is that the framework will switch the port to
DSA_PORT_TYPE_UNUSED, so we can stop caring about DSA_PORT_TYPE_DSA in
all other places.
Signed-off-by: Daniel Golle <daniel@xxxxxxxxxxxxxx>
---
drivers/net/dsa/mxl862xx/mxl862xx.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/mxl862xx/mxl862xx.c b/drivers/net/dsa/mxl862xx/mxl862xx.c
index e4e16c7207630..9a9714c4859b1 100644
--- a/drivers/net/dsa/mxl862xx/mxl862xx.c
+++ b/drivers/net/dsa/mxl862xx/mxl862xx.c
@@ -544,10 +544,14 @@ static int mxl862xx_port_setup(struct dsa_switch *ds, int port)
mxl862xx_port_fast_age(ds, port);
- if (dsa_port_is_unused(dp) ||
- dsa_port_is_dsa(dp))
+ if (dsa_port_is_unused(dp))
return 0;
+ if (dsa_port_is_dsa(dp)) {
+ dev_err(ds->dev, "port %d: DSA links not supported\n", port);
+ return -EOPNOTSUPP;
+ }
+
ret = mxl862xx_configure_sp_tag_proto(ds, port, is_cpu_port);
if (ret)
return ret;
@@ -591,7 +595,7 @@ static void mxl862xx_port_teardown(struct dsa_switch *ds, int port)
struct mxl862xx_priv *priv = ds->priv;
struct dsa_port *dp = dsa_to_port(ds, port);
- if (dsa_port_is_unused(dp) || dsa_port_is_dsa(dp))
+ if (dsa_port_is_unused(dp))
return;
/* Prevent deferred host_flood_work from acting on stale state.
--
2.53.0