Commit ce24c2b8 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller

macb: fix mdiobus_scan() error check

Now mdiobus_scan() returns ERR_PTR(-ENODEV) instead of NULL if the PHY
device ID was read as all ones. As this was not  an error before, this
value  should be filtered out now in this driver.

Fixes: b74766a0 ("phylib: don't return NULL from get_phy_device()")
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6dd74542
...@@ -458,7 +458,8 @@ static int macb_mii_init(struct macb *bp) ...@@ -458,7 +458,8 @@ static int macb_mii_init(struct macb *bp)
struct phy_device *phydev; struct phy_device *phydev;
phydev = mdiobus_scan(bp->mii_bus, i); phydev = mdiobus_scan(bp->mii_bus, i);
if (IS_ERR(phydev)) { if (IS_ERR(phydev) &&
PTR_ERR(phydev) != -ENODEV) {
err = PTR_ERR(phydev); err = PTR_ERR(phydev);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment