summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Godehardt <fg@emlix.com>2014-05-16 06:21:44 +0200
committerDavid S. Miller <davem@davemloft.net>2014-05-16 16:56:33 -0400
commitd1c0b471b340f43fa857d19150e029257d7bb475 (patch)
tree7470d92c8bf68f084a4b9e214b704bcc579c8cc0
parent2e47b291953c35afa4e20a65475954c1a1b9afe1 (diff)
downloadlwn-d1c0b471b340f43fa857d19150e029257d7bb475.tar.gz
lwn-d1c0b471b340f43fa857d19150e029257d7bb475.zip
net/dsa/dsa.c: increment chip_index during of_node handling on dsa_of_probe()
Adding more than one chip on device-tree currently causes the probing routine to always use the first chips data pointer. Signed-off-by: Fabian Godehardt <fg@emlix.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/dsa/dsa.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 0eb5d5e76dfb..5db37cef50a9 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -406,8 +406,9 @@ static int dsa_of_probe(struct platform_device *pdev)
goto out_free;
}
- chip_index = 0;
+ chip_index = -1;
for_each_available_child_of_node(np, child) {
+ chip_index++;
cd = &pd->chip[chip_index];
cd->mii_bus = &mdio_bus->dev;