From 11af8d65274df736deeb651d12e0763eec527ea5 Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Mon, 9 Jul 2012 08:52:43 +0000 Subject: net: abort network initialization if the PHY driver fails Now that phy_startup() can return an actual error code, check for that error code and abort network initialization if the PHY fails. Signed-off-by: Timur Tabi Acked-by: Nobuhiro Iwamamatsu (sh_eth part) Acked-by: Stephan Linz (Xilinx part, xilinx_axi_emac and xilinx_ll_temac) Reviewed-by: Marek Vasut (FEC part) --- drivers/net/xilinx_axi_emac.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/net/xilinx_axi_emac.c') diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c index 7854a04..d777144 100644 --- a/drivers/net/xilinx_axi_emac.c +++ b/drivers/net/xilinx_axi_emac.c @@ -272,7 +272,11 @@ static int setup_phy(struct eth_device *dev) phydev->advertising = phydev->supported; priv->phydev = phydev; phy_config(phydev); - phy_startup(phydev); + if (phy_startup(phydev)) { + printf("axiemac: could not initialize PHY %s\n", + phydev->dev->name); + return 0; + } switch (phydev->speed) { case 1000: -- cgit v1.1