]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: axi_emac: Check if phy was correctly detected
authorMichal Simek <michal.simek@xilinx.com>
Thu, 21 Nov 2013 15:15:51 +0000 (16:15 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 21 Nov 2013 15:17:49 +0000 (16:17 +0100)
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

index b07d8a7539f75172c2cbf74c09dce50affe34382..aded3d951d5a58a4df144c54a58c29a7561e62ff 100644 (file)
@@ -282,6 +282,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: