]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: microchip: ksz8795: use phy_port_cnt where possible
authorMichael Grzeschik <m.grzeschik@pengutronix.de>
Tue, 1 Dec 2020 20:45:01 +0000 (21:45 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 3 Dec 2020 01:16:29 +0000 (17:16 -0800)
commit8300f62230d4c159ba30f4e9141eb9b6e9fbe323
tree0c14e1229fe90a02bc4a83a554a2501bf6e298ae
parentee868088dbfd5594f1f9546b168ec2d50b25acc2
net: dsa: microchip: ksz8795: use phy_port_cnt where possible

The driver is currently hard coded to SWITCH_PORT_NUM being
(TOTAL_PORT_NUM - 1) which is limited to 4 user ports for the ksz8795.
The phy_port_cnt is referring to its user ports. The patch removes the
extra define and use the assigned variable phy_port_cnt instead so the
driver can be used on different switches.

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>
drivers/net/dsa/microchip/ksz8795.c
drivers/net/dsa/microchip/ksz8795_reg.h