dsa: correctly determine the number of switches in a system
Subsystems (3)
PATCH 1/1 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.
Signed-off-by Tobias Waldekranz <[email protected]>
--- net/dsa/dsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/dsa/dsa.c +1 -1
@@ -603,7 +603,7 @@ static int dsa_of_probe(struct platform_device *pdev) pdev->dev.platform_data = pd; pd->netdev = ðernet_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 ) pd->nr_chips =DSA_MAX_SWITCHES ;
Signature · 1 line
1.8.4.357.g8d83871.dirty
Quoted 5 lines · Tobias Waldekranz
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.
Signed-off-by Tobias Waldekranz <[email protected]>
Acked-by Florian Fainelli <[email protected]>
Fixes 5e95329b701c4 ("dsa: add device tree bindings to register DSA
switches")
Quoted 18 lines
--- net/dsa/dsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/dsa/dsa.c +1
-1@@ -603,7 +603,7 @@ static int dsa_of_probe(struct platform_device *pdev) pdev->dev.platform_data = pd; pd->netdev = ðernet_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 ) pd->nr_chips =DSA_MAX_SWITCHES ;
Signature · 1 line
Florian
From: Tobias Waldekranz <[email protected]>
Date: Thu, 5 Feb 2015 14:54:09 +0100
Quoted 5 lines
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.
Signed-off-by Tobias Waldekranz <[email protected]>
Applied.