]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: mvpp2: use port_count to remove ports
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Thu, 8 Aug 2024 09:47:32 +0000 (11:47 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Aug 2024 16:00:33 +0000 (17:00 +0100)
commite81d00a6b3b7d619060223d0754ca02e7d4ba90f
treef53d1479022a393915617a1e1a8808149d5d5174
parent80d021bc572fbf1b59b029672df5be069dd078ae
net: mvpp2: use port_count to remove ports

As discussed in [1], there is no need to iterate over child nodes to
remove the list of ports. Instead, a loop up to `port_count` ports can
be used, and is in fact more reliable in case the child node
availability changes.

The suggested approach removes the need for the `fwnode` and
`port_fwnode` variables in mvpp2_remove() as well.

Link: https://lore.kernel.org/all/ZqdRgDkK1PzoI2Pf@shell.armlinux.org.uk/
Suggested-by: Russell King <linux@armlinux.org.uk>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c