diff options
| author | Tobias Waldekranz <[email protected]> | 2015-02-05 13:54:09 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2015-02-08 06:07:37 +0000 |
| commit | e04449fcf2cd63dec176355a028bd28b4d469be9 (patch) | |
| tree | 09092393163b21a8f41f5dda29d7b9a9e082515f /net/dsa/dsa.c | |
| parent | dsa: do not dereference non-existing routing table (diff) | |
| download | kernel-e04449fcf2cd63dec176355a028bd28b4d469be9.tar.gz kernel-e04449fcf2cd63dec176355a028bd28b4d469be9.zip | |
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: 5e95329b701c4 ("dsa: add device tree bindings to register DSA switches")
Signed-off-by: Tobias Waldekranz <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/dsa/dsa.c')
| -rw-r--r-- | net/dsa/dsa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 37317149f918..2173402d87e0 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -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; |
