diff options
author | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2020-12-01 21:45:06 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-12-02 17:16:29 -0800 |
commit | 02ffbb0270efb372f163d21ef1b25e89ffd4190c (patch) | |
tree | 1102232d4795100b0715867d3c71beefd4c42057 /drivers/net/dsa/microchip | |
parent | 241ed719bc9884758f8953550f2ed22715b24339 (diff) | |
download | linux-stable-02ffbb0270efb372f163d21ef1b25e89ffd4190c.tar.gz linux-stable-02ffbb0270efb372f163d21ef1b25e89ffd4190c.tar.bz2 linux-stable-02ffbb0270efb372f163d21ef1b25e89ffd4190c.zip |
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: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa/microchip')
-rw-r--r-- | drivers/net/dsa/microchip/ksz8795.c | 2 | ||||
-rw-r--r-- | drivers/net/dsa/microchip/ksz8795_reg.h | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index b13ac57ab8bb..c973db101b72 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -1084,7 +1084,7 @@ static int ksz8795_setup(struct dsa_switch *ds) (BROADCAST_STORM_VALUE * 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); /* Setup STP address for STP operation. */ diff --git a/drivers/net/dsa/microchip/ksz8795_reg.h b/drivers/net/dsa/microchip/ksz8795_reg.h index 681d19ab27b8..40372047d40d 100644 --- a/drivers/net/dsa/microchip/ksz8795_reg.h +++ b/drivers/net/dsa/microchip/ksz8795_reg.h @@ -989,7 +989,6 @@ #define TAIL_TAG_OVERRIDE BIT(6) #define TAIL_TAG_LOOKUP BIT(7) -#define VLAN_TABLE_ENTRIES (4096 / 4) #define FID_ENTRIES 128 #endif |