Browse Source

net: axi_emac: Check if phy was correctly detected

As tsec and fm drivers checking phydev->link
ensure that u-boot don't try access device if link is not ready.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek 11 years ago
parent
commit
6f9b93723a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      drivers/net/xilinx_axi_emac.c

+ 4 - 0
drivers/net/xilinx_axi_emac.c

@@ -261,6 +261,10 @@ static int setup_phy(struct eth_device *dev)
 		       phydev->dev->name);
 		return 0;
 	}
+	if (!phydev->link) {
+		printf("%s: No link.\n", phydev->dev->name);
+		return 0;
+	}
 
 	switch (phydev->speed) {
 	case 1000: