[PATCH] cpsw: fix dt probe for one port ethernet

Alexander Aring alex.aring at gmail.com
Thu Dec 12 02:21:04 EST 2013


Taken from linux-omap mailinglist. See:

http://marc.info/?l=linux-omap&m=138682143215842&w=2

Original commit-msg:

When only one port of the two port is pinned out, then dt probe is failing
because second port phy is not found. fixing this by checking the number of
slaves and breaking the loop.

Signed-off-by: Alexander Aring <alex.aring at gmail.com>
---
I think we need this, too. Only compile tested.

 drivers/net/cpsw.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 5e68e1b..f82117c 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -1076,6 +1076,8 @@ static int cpsw_probe_dt(struct cpsw_priv *priv)
 			slave->phy_if = of_get_phy_mode(child);
 
 			i++;
+			if (i == priv->num_slaves)
+				break;
 		}
 	}
 
-- 
1.8.4.2




More information about the barebox mailing list