diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2020-09-10 18:48:55 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-12 02:30:43 +0200 |
commit | 7e092af2f3b33694b9117ffd978d42b04ec4f260 (patch) | |
tree | 8553a1560d7292eb7a5c8a7bc03054142db4e644 /drivers/net/dsa/sja1105 | |
parent | net: dsa: tag_8021q: include missing refcount.h (diff) | |
download | linux-7e092af2f3b33694b9117ffd978d42b04ec4f260.tar.xz linux-7e092af2f3b33694b9117ffd978d42b04ec4f260.zip |
net: dsa: tag_8021q: setup tagging via a single function call
There is no point in calling dsa_port_setup_8021q_tagging for each
individual port. Additionally, it will become more difficult to do that
when we'll have a context structure to tag_8021q (next patch). So
refactor this now.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/sja1105')
-rw-r--r-- | drivers/net/dsa/sja1105/sja1105_main.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index 5a28dfb36ec3..508494390e81 100644 --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -1934,18 +1934,11 @@ static void sja1105_crosschip_bridge_leave(struct dsa_switch *ds, static int sja1105_setup_8021q_tagging(struct dsa_switch *ds, bool enabled) { struct sja1105_private *priv = ds->priv; - int rc, i; + int rc; - for (i = 0; i < SJA1105_NUM_PORTS; i++) { - priv->expect_dsa_8021q = true; - rc = dsa_port_setup_8021q_tagging(ds, i, enabled); - priv->expect_dsa_8021q = false; - if (rc < 0) { - dev_err(ds->dev, "Failed to setup VLAN tagging for port %d: %d\n", - i, rc); - return rc; - } - } + rc = dsa_8021q_setup(priv->ds, enabled); + if (rc) + return rc; dev_info(ds->dev, "%s switch tagging\n", enabled ? "Enabled" : "Disabled"); |