Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e04449fc authored by Tobias Waldekranz's avatar Tobias Waldekranz Committed by David S. Miller
Browse files

dsa: correctly determine the number of switches in a system



The number of connected switches was sourced from the number of
children to the DSA node, change it to the number of available
children, skipping any disabled switches.

Fixes: 5e95329b ("dsa: add device tree bindings to register DSA switches")
Signed-off-by: default avatarTobias Waldekranz <tobias@waldekranz.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6e0ba47f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -603,7 +603,7 @@ static int dsa_of_probe(struct platform_device *pdev)


	pdev->dev.platform_data = pd;
	pdev->dev.platform_data = pd;
	pd->netdev = &ethernet_dev->dev;
	pd->netdev = &ethernet_dev->dev;
	pd->nr_chips = of_get_child_count(np);
	pd->nr_chips = of_get_available_child_count(np);
	if (pd->nr_chips > DSA_MAX_SWITCHES)
	if (pd->nr_chips > DSA_MAX_SWITCHES)
		pd->nr_chips = DSA_MAX_SWITCHES;
		pd->nr_chips = DSA_MAX_SWITCHES;