diff options
| author | Timur Tabi <timur@freescale.com> | 2012-07-09 08:52:43 +0000 | 
|---|---|---|
| committer | Joe Hershberger <joe.hershberger@ni.com> | 2012-07-11 13:15:30 -0500 | 
| commit | 11af8d65274df736deeb651d12e0763eec527ea5 (patch) | |
| tree | f1a168fd00307be243b3978fdceace496e6eabc8 /drivers/net/xilinx_axi_emac.c | |
| parent | 6e5b9ac097689e96d53f638842823fb1d1bf4223 (diff) | |
| download | olio-uboot-2014.01-11af8d65274df736deeb651d12e0763eec527ea5.tar.xz olio-uboot-2014.01-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.c | 6 | 
1 files changed, 5 insertions, 1 deletions
| diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c index 7854a04ca..d77714440 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: |