From: Mugunthan V N Date: Thu, 28 Apr 2016 15:36:04 +0530 Subject: [U-Boot] [PATCH v3 03/12] drivers: net: cpsw: fix cpsw dp parse when num slaves as 1 In-Reply-To: <20160428100613.3438-1-mugunthanvnm@ti.com> References: <20160428100613.3438-1-mugunthanvnm@ti.com> Message-ID: <20160428100613.3438-4-mugunthanvnm@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Reviewed-by: Tom Rini Acked-by: Joe Hershberger --- drivers/net/cpsw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c index 7104754..971ebf0 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 = -- 2.8.1.339.g3ad15fd