From: Tabi Timur-B04825 <B04825@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] net: abort network initialization if the PHY driver fails
Date: Fri, 6 Jul 2012 01:58:36 +0000 [thread overview]
Message-ID: <4FF6464B.4040904@freescale.com> (raw)
In-Reply-To: <CABMQnVLy3ArADT5kee5eZTAPr_y9cTZUTth6u_03UhXW5gCL-w@mail.gmail.com>
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
next prev parent reply other threads:[~2012-07-06 1:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-05 20:33 [U-Boot] [PATCH 1/2] phylib: phy_startup() should return an error code on failure Timur Tabi
2012-07-05 20:33 ` [U-Boot] [PATCH 2/2] net: abort network initialization if the PHY driver fails Timur Tabi
2012-07-06 0:31 ` Nobuhiro Iwamatsu
2012-07-06 1:58 ` Tabi Timur-B04825 [this message]
2012-07-11 18:31 ` [U-Boot] [PATCH 1/2] phylib: phy_startup() should return an error code on failure Joe Hershberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FF6464B.4040904@freescale.com \
--to=b04825@freescale.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox