]> git.ipfire.org Git - u-boot.git/commitdiff
drivers: net: cpsw: fix cpsw dp parse when num slaves as 1
authorMugunthan V N <mugunthanvnm@ti.com>
Thu, 28 Apr 2016 10:06:04 +0000 (15:36 +0530)
committerJoe Hershberger <joe.hershberger@ni.com>
Tue, 24 May 2016 16:42:02 +0000 (11:42 -0500)
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>
drivers/net/cpsw.c

index 71047544634e6e73707832d08f54d03e5f24e84a..971ebf0d689ed06d2e85b02e92469212b6bceb82 100644 (file)
@@ -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 =