mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 06:41:39 -04:00
net: dsa: mxl862xx: reject DSA_PORT_TYPE_DSA
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@makrotopia.org> Link: https://patch.msgid.link/b686f3a22d8a6e7d470e7aa98da811a996a229b9.1775581804.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
d6aa477045
commit
3a4056ec7e
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user