netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/dsa/dsa.c: increment chip_index during of_node handling on dsa_of_probe()
@ 2014-05-16  4:21 Fabian Godehardt
  2014-05-16 16:12 ` Florian Fainelli
  2014-05-16 20:56 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Fabian Godehardt @ 2014-05-16  4:21 UTC (permalink / raw)
  To: netdev; +Cc: Fabian Godehardt

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>
---
 net/dsa/dsa.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 0eb5d5e..5db37ce 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;
-- 
1.8.2.61.g7b9a419

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-16 20:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-16  4:21 [PATCH] net/dsa/dsa.c: increment chip_index during of_node handling on dsa_of_probe() Fabian Godehardt
2014-05-16 16:12 ` Florian Fainelli
2014-05-16 20:56 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).