Commit d1c0b471 authored by Fabian Godehardt's avatar Fabian Godehardt Committed by David S. Miller

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: default avatarFabian Godehardt <fg@emlix.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2e47b291
...@@ -406,8 +406,9 @@ static int dsa_of_probe(struct platform_device *pdev) ...@@ -406,8 +406,9 @@ static int dsa_of_probe(struct platform_device *pdev)
goto out_free; goto out_free;
} }
chip_index = 0; chip_index = -1;
for_each_available_child_of_node(np, child) { for_each_available_child_of_node(np, child) {
chip_index++;
cd = &pd->chip[chip_index]; cd = &pd->chip[chip_index];
cd->mii_bus = &mdio_bus->dev; cd->mii_bus = &mdio_bus->dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment