Skip to content

Commit

Permalink
net/dsa/dsa.c: increment chip_index during of_node handling on dsa_of…
Browse files Browse the repository at this point in the history
…_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>
  • Loading branch information
Fabian Godehardt authored and David S. Miller committed May 16, 2014
1 parent 2e47b29 commit d1c0b47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/dsa/dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d1c0b47

Please sign in to comment.