diff mbox

[U-Boot,2/2] net: axi_emac: Check if phy was correctly detected

Message ID dc85731a7b5badf41df7bd4b8e58ca1ba023d7ba.1388741947.git.michal.simek@xilinx.com
State Accepted
Delegated to: Joe Hershberger
Headers show

Commit Message

Michal Simek Jan. 3, 2014, 9:39 a.m. UTC
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>
---

 drivers/net/xilinx_axi_emac.c | 4 ++++
 1 file changed, 4 insertions(+)

--
1.8.2.3
diff mbox

Patch

diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
index bb5044b..262b67b 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: