[U-Boot] [PATCH 2/2] [v2] net: abort network initialization if the PHY driver fails

Marek Vasut marex at denx.de
Mon Jul 9 18:37:59 CEST 2012


Dear Timur Tabi,

> 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 at freescale.com>
> ---
>  drivers/net/fec_mxc.c         |    7 ++++++-
>  drivers/net/fm/eth.c          |    9 ++++++++-
>  drivers/net/sh_eth.c          |    6 +++++-
>  drivers/net/tsec.c            |    8 +++++++-
>  drivers/net/xilinx_axi_emac.c |    6 +++++-
>  drivers/net/xilinx_ll_temac.c |    8 +++++++-
>  6 files changed, 38 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index eee41d7..e62ae61 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -510,7 +510,12 @@ 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;
For the FEC

Reviewed-by: Marek Vasut <marex at denx.de>

Best regards,
Marek Vasut


More information about the U-Boot mailing list