]> git.baikalelectronics.ru Git - kernel.git/commit
net: lan966x: hardcode the number of external ports
authorMichael Walle <michael@walle.cc>
Mon, 4 Jul 2022 15:36:54 +0000 (17:36 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 6 Jul 2022 00:52:08 +0000 (17:52 -0700)
commit51de4463fcb5e88babcc3a99fa0e81a34622ea7e
tree68d5d061ea19df73ff720cc02a98b38bdd4a934c
parent2cf65fbb20239079896ffa8e00ea42f700e1570f
net: lan966x: hardcode the number of external ports

Instead of counting the child nodes in the device tree, hardcode the
number of ports in the driver itself.  The counting won't work at all
if an ethernet port is marked as disabled, e.g. because it is not
connected on the board at all.

It turns out that the LAN9662 and LAN9668 use the same switching IP
with the same synthesis parameters. The only difference is that the
output ports are not connected. Thus, we can just hardcode the
number of physical ports to 8.

Fixes: 972d3be0c013 ("net: lan966x: add the basic lan966x driver")
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Link: https://lore.kernel.org/r/20220704153654.46dcc8b-1-michael@walle.cc
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/lan966x/lan966x_main.c
drivers/net/ethernet/microchip/lan966x/lan966x_main.h