diff options
author | Timur Tabi | 2012-07-09 08:52:43 +0000 |
---|---|---|
committer | Joe Hershberger | 2012-07-11 13:15:30 -0500 |
commit | 11af8d65274df736deeb651d12e0763eec527ea5 (patch) | |
tree | f1a168fd00307be243b3978fdceace496e6eabc8 /drivers/net/fec_mxc.c | |
parent | 6e5b9ac097689e96d53f638842823fb1d1bf4223 (diff) |
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/fec_mxc.c')
-rw-r--r-- | drivers/net/fec_mxc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index eee41d7c8b7..57005521899 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -510,7 +510,13 @@ static int fec_open(struct eth_device *edev) fec_eth_phy_config(edev); if (fec->phydev) { /* Start up the PHY */ - phy_startup(fec->phydev); + int ret = phy_startup(fec->phydev); + + if (ret) { + printf("Could not initialize PHY %s\n", + fec->phydev->dev->name); + return ret; + } speed = fec->phydev->speed; } else { speed = _100BASET; |