Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Vladimir Oltean and committed by
David S. Miller
e74f014e 864cd7b0

+2 -4
+2 -3
drivers/net/dsa/b53/b53_common.c
··· 428 428 b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt); 429 429 430 430 dev->vlan_enabled = enable; 431 - dev->vlan_filtering_enabled = enable_filtering; 432 431 } 433 432 434 433 static int b53_set_jumbo(struct b53_device *dev, bool enable, bool allow_10_100) ··· 664 665 b53_do_vlan_op(dev, VTA_CMD_CLEAR); 665 666 } 666 667 667 - b53_enable_vlan(dev, false, dev->vlan_filtering_enabled); 668 + b53_enable_vlan(dev, false, ds->vlan_filtering); 668 669 669 670 b53_for_each_port(dev, i) 670 671 b53_write16(dev, B53_VLAN_PAGE, ··· 1317 1318 if (vlan->vid_end > dev->num_vlans) 1318 1319 return -ERANGE; 1319 1320 1320 - b53_enable_vlan(dev, true, dev->vlan_filtering_enabled); 1321 + b53_enable_vlan(dev, true, ds->vlan_filtering); 1321 1322 1322 1323 return 0; 1323 1324 }
-1
drivers/net/dsa/b53/b53_priv.h
··· 139 139 unsigned int num_vlans; 140 140 struct b53_vlan *vlans; 141 141 bool vlan_enabled; 142 - bool vlan_filtering_enabled; 143 142 unsigned int num_ports; 144 143 struct b53_port *ports; 145 144 };