Commit 02ffbb02 authored by Michael Grzeschik's avatar Michael Grzeschik Committed by Jakub Kicinski

net: dsa: microchip: ksz8795: use num_vlans where possible

The value of the define VLAN_TABLE_ENTRIES can be derived from
num_vlans. This patch is using the variable num_vlans instead and
removes the extra define.
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 241ed719
...@@ -1084,7 +1084,7 @@ static int ksz8795_setup(struct dsa_switch *ds) ...@@ -1084,7 +1084,7 @@ static int ksz8795_setup(struct dsa_switch *ds)
(BROADCAST_STORM_VALUE * (BROADCAST_STORM_VALUE *
BROADCAST_STORM_PROT_RATE) / 100); BROADCAST_STORM_PROT_RATE) / 100);
for (i = 0; i < VLAN_TABLE_ENTRIES; i++) for (i = 0; i < (dev->num_vlans / 4); i++)
ksz8795_r_vlan_entries(dev, i); ksz8795_r_vlan_entries(dev, i);
/* Setup STP address for STP operation. */ /* Setup STP address for STP operation. */
......
...@@ -989,7 +989,6 @@ ...@@ -989,7 +989,6 @@
#define TAIL_TAG_OVERRIDE BIT(6) #define TAIL_TAG_OVERRIDE BIT(6)
#define TAIL_TAG_LOOKUP BIT(7) #define TAIL_TAG_LOOKUP BIT(7)
#define VLAN_TABLE_ENTRIES (4096 / 4)
#define FID_ENTRIES 128 #define FID_ENTRIES 128
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment