Browse Source

drivers: net: cpsw: fix dt probe for one port ethernet

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: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Mugunthan V N 11 years ago
parent
commit
3a27bfac17
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/net/ethernet/ti/cpsw.c

+ 2 - 0
drivers/net/ethernet/ti/cpsw.c

@@ -1816,6 +1816,8 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
 		}
 
 		i++;
+		if (i == data->slaves)
+			break;
 	}
 
 	return 0;