From: Oleksij Rempel Date: Wed, 21 Apr 2021 13:05:40 +0000 (+0200) Subject: net: dsa: fix bridge support for drivers without port_bridge_flags callback X-Git-Tag: v5.13-rc1~94^2~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=70a7c484c7c3eaa17b679db2c74ec8ecbe8dc0e8;p=thirdparty%2Flinux.git net: dsa: fix bridge support for drivers without port_bridge_flags callback Starting with patch: a8b659e7ff75 ("net: dsa: act as passthrough for bridge port flags") drivers without "port_bridge_flags" callback will fail to join the bridge. Looking at the code, -EOPNOTSUPP seems to be the proper return value, which makes at least microchip and atheros switches work again. Fixes: 5961d6a12c13 ("net: dsa: inherit the actual bridge port flags at join time") Signed-off-by: Oleksij Rempel Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller --- diff --git a/net/dsa/port.c b/net/dsa/port.c index 01e30264b25be..6379d66a6bb32 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -550,7 +550,7 @@ int dsa_port_bridge_flags(const struct dsa_port *dp, struct dsa_switch *ds = dp->ds; if (!ds->ops->port_bridge_flags) - return -EINVAL; + return -EOPNOTSUPP; return ds->ops->port_bridge_flags(ds, dp->index, flags, extack); }