summaryrefslogtreecommitdiffstats
path: root/drivers/net/xilinx_axi_emac.c
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2012-07-09 08:52:43 +0000
committerJoe Hershberger <joe.hershberger@ni.com>2012-07-11 13:15:30 -0500
commit11af8d65274df736deeb651d12e0763eec527ea5 (patch)
treef1a168fd00307be243b3978fdceace496e6eabc8 /drivers/net/xilinx_axi_emac.c
parent6e5b9ac097689e96d53f638842823fb1d1bf4223 (diff)
downloadtalos-obmc-uboot-11af8d65274df736deeb651d12e0763eec527ea5.tar.gz
talos-obmc-uboot-11af8d65274df736deeb651d12e0763eec527ea5.zip
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 <timur@freescale.com> Acked-by: Nobuhiro Iwamamatsu <nobuhiro.iwamatsu.yj@renesas.com> (sh_eth part) Acked-by: Stephan Linz <linz@li-pro.net> (Xilinx part, xilinx_axi_emac and xilinx_ll_temac) Reviewed-by: Marek Vasut <marex@denx.de> (FEC part)
Diffstat (limited to 'drivers/net/xilinx_axi_emac.c')
-rw-r--r--drivers/net/xilinx_axi_emac.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
index 7854a04cae..d77714440a 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:
OpenPOWER on IntegriCloud