If the PHY is not recognized don't access phydev (NULL)
and return 0 to signal failure.

Signed-off-by: Claudiu Manoil <claudiu.man...@freescale.com>
---
 drivers/net/tsec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index e9138f0..65fb2b0 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -590,6 +590,8 @@ static int init_phy(struct eth_device *dev)
                tsec_configure_serdes(priv);
 
        phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface);
+       if (!phydev)
+               return 0;
 
        phydev->supported &= supported;
        phydev->advertising = phydev->supported;
-- 
1.7.11.7


_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to