Skip to content

Commit

Permalink
net: dsa: microchip: ksz8795: remove superfluous port_cnt assignment
Browse files Browse the repository at this point in the history
The port_cnt assignment will be done again in the init function.
This patch removes the previous assignment in the detect function.

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>
  • Loading branch information
Michael Grzeschik authored and Jakub Kicinski committed Dec 3, 2020
1 parent 453aa4c commit 68a1b67
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/net/dsa/microchip/ksz8795.c
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,6 @@ static int ksz8795_switch_detect(struct ksz_device *dev)

dev->mib_port_cnt = TOTAL_PORT_NUM;
dev->phy_port_cnt = SWITCH_PORT_NUM;
dev->port_cnt = SWITCH_PORT_NUM;

if (id2 == CHIP_ID_95) {
u8 val;
Expand All @@ -1162,7 +1161,6 @@ static int ksz8795_switch_detect(struct ksz_device *dev)
if (val & PORT_FIBER_MODE)
id2 = 0x65;
} else if (id2 == CHIP_ID_94) {
dev->port_cnt--;
id2 = 0x94;
}
id16 &= ~0xff;
Expand Down

0 comments on commit 68a1b67

Please sign in to comment.