diff options
author | Vladimir Oltean <olteanv@gmail.com> | 2019-04-28 14:45:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-30 23:05:29 -0400 |
commit | e74f014eb4ceeeefe4e5058daac705422eecb683 (patch) | |
tree | 162e6cfca270431f829a2fe0ae1676a01cad57e2 | |
parent | 864cd7b05dec190c7331a59c899749dbe940ecad (diff) |
net: dsa: b53: Use vlan_filtering property from dsa_switch
While possible (and safe) to use the newly introduced
dsa_port_is_vlan_filtering helper, fabricating a dsa_port pointer is a
bit awkward, so simply retrieve this from the dsa_switch structure.
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/dsa/b53/b53_common.c | 5 | ||||
-rw-r--r-- | drivers/net/dsa/b53/b53_priv.h | 1 |
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 9fbeb20ba263..c8040ecf4425 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c | |||
@@ -428,7 +428,6 @@ static void b53_enable_vlan(struct b53_device *dev, bool enable, | |||
428 | b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt); | 428 | b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt); |
429 | 429 | ||
430 | dev->vlan_enabled = enable; | 430 | dev->vlan_enabled = enable; |
431 | dev->vlan_filtering_enabled = enable_filtering; | ||
432 | } | 431 | } |
433 | 432 | ||
434 | static int b53_set_jumbo(struct b53_device *dev, bool enable, bool allow_10_100) | 433 | static int b53_set_jumbo(struct b53_device *dev, bool enable, bool allow_10_100) |
@@ -665,7 +664,7 @@ int b53_configure_vlan(struct dsa_switch *ds) | |||
665 | b53_do_vlan_op(dev, VTA_CMD_CLEAR); | 664 | b53_do_vlan_op(dev, VTA_CMD_CLEAR); |
666 | } | 665 | } |
667 | 666 | ||
668 | b53_enable_vlan(dev, false, dev->vlan_filtering_enabled); | 667 | b53_enable_vlan(dev, false, ds->vlan_filtering); |
669 | 668 | ||
670 | b53_for_each_port(dev, i) | 669 | b53_for_each_port(dev, i) |
671 | b53_write16(dev, B53_VLAN_PAGE, | 670 | b53_write16(dev, B53_VLAN_PAGE, |
@@ -1318,7 +1317,7 @@ int b53_vlan_prepare(struct dsa_switch *ds, int port, | |||
1318 | if (vlan->vid_end > dev->num_vlans) | 1317 | if (vlan->vid_end > dev->num_vlans) |
1319 | return -ERANGE; | 1318 | return -ERANGE; |
1320 | 1319 | ||
1321 | b53_enable_vlan(dev, true, dev->vlan_filtering_enabled); | 1320 | b53_enable_vlan(dev, true, ds->vlan_filtering); |
1322 | 1321 | ||
1323 | return 0; | 1322 | return 0; |
1324 | } | 1323 | } |
diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h index e3441dcf2d21..f25bc80c4ffc 100644 --- a/drivers/net/dsa/b53/b53_priv.h +++ b/drivers/net/dsa/b53/b53_priv.h | |||
@@ -139,7 +139,6 @@ struct b53_device { | |||
139 | unsigned int num_vlans; | 139 | unsigned int num_vlans; |
140 | struct b53_vlan *vlans; | 140 | struct b53_vlan *vlans; |
141 | bool vlan_enabled; | 141 | bool vlan_enabled; |
142 | bool vlan_filtering_enabled; | ||
143 | unsigned int num_ports; | 142 | unsigned int num_ports; |
144 | struct b53_port *ports; | 143 | struct b53_port *ports; |
145 | }; | 144 | }; |