From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tabi Timur-B04825 Date: Fri, 6 Jul 2012 01:58:36 +0000 Subject: [U-Boot] [PATCH 2/2] net: abort network initialization if the PHY driver fails In-Reply-To: References: <1341520399-5889-1-git-send-email-timur@freescale.com> <1341520399-5889-2-git-send-email-timur@freescale.com> Message-ID: <4FF6464B.4040904@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Nobuhiro Iwamatsu wrote: >> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c >> index eee41d7..7a3d16b 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", >> + fm_eth->phydev->dev->name); > > Probably this is fec, not fm_eth. Thanks. I thought I was being diligent, and I ran MAKEALL, but I guess it wasn't enough. >> diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c >> index 7854a04..d777144 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: > > Why doesn't this driver use a ret variable? > Other driver's patch used this. Because setup_phy() returns either 0 (failure) or 1 (success). -- Timur Tabi Linux kernel developer at Freescale