summaryrefslogtreecommitdiff
path: root/drivers/net/fec_mxc.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/fec_mxc.c
parent6e5b9ac097689e96d53f638842823fb1d1bf4223 (diff)
downloadu-boot-imx-11af8d65274df736deeb651d12e0763eec527ea5.zip
u-boot-imx-11af8d65274df736deeb651d12e0763eec527ea5.tar.gz
u-boot-imx-11af8d65274df736deeb651d12e0763eec527ea5.tar.bz2
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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index eee41d7..5700552 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;