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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
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


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux