From cf360866b11901eca5317e8a5c26c3e15b7bf1f2 Mon Sep 17 00:00:00 2001 From: Vivien Didelot Date: Sun, 25 Aug 2019 13:25:16 -0400 Subject: net: dsa: do not skip -EOPNOTSUPP in dsa_port_vid_add Currently dsa_port_vid_add returns 0 if the switch returns -EOPNOTSUPP. This function is used in the tag_8021q.c code to offload the PVID of ports, which would simply not work if .port_vlan_add is not supported by the underlying switch. Do not skip -EOPNOTSUPP in dsa_port_vid_add but only when necessary, that is to say in dsa_slave_vlan_rx_add_vid. Signed-off-by: Vivien Didelot Signed-off-by: David S. Miller --- net/dsa/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/dsa/port.c') diff --git a/net/dsa/port.c b/net/dsa/port.c index f75301456430..ef28df7ecbde 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -382,8 +382,8 @@ int dsa_port_vid_add(struct dsa_port *dp, u16 vid, u16 flags) trans.ph_prepare = true; err = dsa_port_vlan_add(dp, &vlan, &trans); - if (err == -EOPNOTSUPP) - return 0; + if (err) + return err; trans.ph_prepare = false; return dsa_port_vlan_add(dp, &vlan, &trans); -- cgit v1.2.3