diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-12-15 16:09:36 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-18 14:57:48 -0500 |
commit | 20b56ed9f8adfb9a7fb1c878878c54aa4ed645c1 (patch) | |
tree | 9825e1c238fbe2d3c38b7dbcb46aa2875d25fcf7 | |
parent | 75e8e15635e08f2598ecd20f4f71f4d043dd6e68 (diff) | |
download | linux-20b56ed9f8adfb9a7fb1c878878c54aa4ed645c1.tar.bz2 |
sfp: fix non-detection of PHY
The detection of a PHY changed in commit e98a3aabf85f ("mdio_bus: don't
return NULL from mdiobus_scan()") which now causes sfp to print an
error message. Update for this change.
Fixes: 73970055450e ("sfp: add SFP module support")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/phy/sfp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 96511557eb2c..1a958c7b912d 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -356,12 +356,12 @@ static void sfp_sm_probe_phy(struct sfp *sfp) msleep(T_PHY_RESET_MS); phy = mdiobus_scan(sfp->i2c_mii, SFP_PHY_ADDR); - if (IS_ERR(phy)) { - dev_err(sfp->dev, "mdiobus scan returned %ld\n", PTR_ERR(phy)); + if (phy == ERR_PTR(-ENODEV)) { + dev_info(sfp->dev, "no PHY detected\n"); return; } - if (!phy) { - dev_info(sfp->dev, "no PHY detected\n"); + if (IS_ERR(phy)) { + dev_err(sfp->dev, "mdiobus scan returned %ld\n", PTR_ERR(phy)); return; } |