From: Michal Simek Date: Thu, 21 Nov 2013 15:15:51 +0000 (+0100) Subject: net: axi_emac: Check if phy was correctly detected X-Git-Tag: v2014.04-rc1~112^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6f9b93723a39dc6d6231c842bb0166bd6258ee53;p=karo-tx-uboot.git 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 --- diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c index bb5044b31f..262b67b6cf 100644 --- a/drivers/net/xilinx_axi_emac.c +++ b/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: