Skip to content

Commit e74f014

Browse files
vladimirolteandavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 864cd7b commit e74f014

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

drivers/net/dsa/b53/b53_common.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ static void b53_enable_vlan(struct b53_device *dev, bool enable,
428428
b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt);
429429

430430
dev->vlan_enabled = enable;
431-
dev->vlan_filtering_enabled = enable_filtering;
432431
}
433432

434433
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)
665664
b53_do_vlan_op(dev, VTA_CMD_CLEAR);
666665
}
667666

668-
b53_enable_vlan(dev, false, dev->vlan_filtering_enabled);
667+
b53_enable_vlan(dev, false, ds->vlan_filtering);
669668

670669
b53_for_each_port(dev, i)
671670
b53_write16(dev, B53_VLAN_PAGE,
@@ -1318,7 +1317,7 @@ int b53_vlan_prepare(struct dsa_switch *ds, int port,
13181317
if (vlan->vid_end > dev->num_vlans)
13191318
return -ERANGE;
13201319

1321-
b53_enable_vlan(dev, true, dev->vlan_filtering_enabled);
1320+
b53_enable_vlan(dev, true, ds->vlan_filtering);
13221321

13231322
return 0;
13241323
}

drivers/net/dsa/b53/b53_priv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ struct b53_device {
139139
unsigned int num_vlans;
140140
struct b53_vlan *vlans;
141141
bool vlan_enabled;
142-
bool vlan_filtering_enabled;
143142
unsigned int num_ports;
144143
struct b53_port *ports;
145144
};

0 commit comments

Comments
 (0)