diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2016-04-30 22:47:36 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-03 19:03:09 (GMT) |
commit | ce24c2b8a904753701fe4df313b4cbc2b0649e3e (patch) | |
tree | 980a803e8bbc626b1a565b792b280c35d4621847 | |
parent | 6dd745425807dc977bbea810ef703b935002fcc3 (diff) | |
download | linux-ce24c2b8a904753701fe4df313b4cbc2b0649e3e.tar.xz |
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: b74766a0a0fe ("phylib: don't return NULL from get_phy_device()")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/cadence/macb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 48a7d7d..898f06f 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -458,7 +458,8 @@ static int macb_mii_init(struct macb *bp) struct phy_device *phydev; phydev = mdiobus_scan(bp->mii_bus, i); - if (IS_ERR(phydev)) { + if (IS_ERR(phydev) && + PTR_ERR(phydev) != -ENODEV) { err = PTR_ERR(phydev); break; } |