]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/net/tsec.c
net: abort network initialization if the PHY driver fails
[karo-tx-uboot.git] / drivers / net / tsec.c
index 3c1c8f0799c4177a1a4371e7cda27855510e61ec..f5e314b9ee06c366ae1360bc4b6b1f0452aa3eb6 100644 (file)
@@ -480,6 +480,7 @@ static int tsec_init(struct eth_device *dev, bd_t * bd)
        int i;
        struct tsec_private *priv = (struct tsec_private *)dev->priv;
        tsec_t *regs = priv->regs;
+       int ret;
 
        /* Make sure the controller is stopped */
        tsec_halt(dev);
@@ -511,7 +512,12 @@ static int tsec_init(struct eth_device *dev, bd_t * bd)
        startup_tsec(dev);
 
        /* Start up the PHY */
-       phy_startup(priv->phydev);
+       ret = phy_startup(priv->phydev);
+       if (ret) {
+               printf("Could not initialize PHY %s\n",
+                      priv->phydev->dev->name);
+               return ret;
+       }
 
        adjust_link(priv, priv->phydev);