mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-14 21:48:49 +00:00
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>
This commit is contained in:
parent
6dd7454258
commit
ce24c2b8a9
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user