diff options
author | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2020-12-01 21:45:02 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-12-03 02:16:29 +0100 |
commit | 557d1a1fbad3023b31ea26eedddd7480350b8359 (patch) | |
tree | 2b0eace81bfbc7d8f0dd5aeb3c954101f3bbd6ec /drivers/net/dsa/microchip | |
parent | net: dsa: microchip: ksz8795: use phy_port_cnt where possible (diff) | |
download | linux-557d1a1fbad3023b31ea26eedddd7480350b8359.tar.xz linux-557d1a1fbad3023b31ea26eedddd7480350b8359.zip |
net: dsa: microchip: remove superfluous num_ports assignment
The variable num_ports is already assigned in the init function. The
drivers individual init function already handles the different purpose
of port_cnt vs port_cnt + 1. This patch removes the extra assignment of
the variable.
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/ksz9477.c | 2 |
2 files changed, 0 insertions, 4 deletions
diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index ee8e82dda314..5cb05ae08f84 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -993,8 +993,6 @@ static void ksz8795_config_cpu_port(struct dsa_switch *ds) u8 remote; int i; - ds->num_ports = dev->port_cnt + 1; - /* Switch marks the maximum frame with extra byte as oversize. */ ksz_cfg(dev, REG_SW_CTRL_2, SW_LEGAL_PACKET_DISABLE, true); ksz_cfg(dev, S_TAIL_TAG_CTRL, SW_TAIL_TAG_ENABLE, true); diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index abfd3802bb51..2119965da10a 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -1267,8 +1267,6 @@ static void ksz9477_config_cpu_port(struct dsa_switch *ds) struct ksz_port *p; int i; - ds->num_ports = dev->port_cnt; - for (i = 0; i < dev->port_cnt; i++) { if (dsa_is_cpu_port(ds, i) && (dev->cpu_ports & (1 << i))) { phy_interface_t interface; |