summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMugunthan V N <mugunthanvnm@ti.com>2016-04-28 15:36:04 +0530
committerJoe Hershberger <joe.hershberger@ni.com>2016-05-24 11:42:02 -0500
commitb2003c5458e883c691f3a7f5f770e6ed36e1b9d7 (patch)
tree986357b636ff192e4bf302e35d90d59838d9e78c /drivers/net
parent3d12e804956ca996b6621cd1e04fabd39b401882 (diff)
downloadtalos-obmc-uboot-b2003c5458e883c691f3a7f5f770e6ed36e1b9d7.tar.gz
talos-obmc-uboot-b2003c5458e883c691f3a7f5f770e6ed36e1b9d7.zip
drivers: net: cpsw: fix cpsw dp parse when num slaves as 1
On some boards number of slaves can be 1 when only one port ethernet is pinned out. So do not break when slave_index and num slaves check fails, instead continue to parse the next child. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/cpsw.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 7104754463..971ebf0d68 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -1209,10 +1209,8 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
if (!strncmp(name, "slave", 5)) {
u32 phy_id[2];
- if (slave_index >= priv->data.slaves) {
- printf("error: num slaves and slave nodes did not match\n");
- return -EINVAL;
- }
+ if (slave_index >= priv->data.slaves)
+ continue;
phy_mode = fdt_getprop(fdt, subnode, "phy-mode", NULL);
if (phy_mode)
priv->data.slave_data[slave_index].phy_if =
OpenPOWER on IntegriCloud