diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-12-15 19:09:36 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-24 13:01:24 +0300 |
commit | 639dab36edbdb186dad9dad40750723a4f820873 (patch) | |
tree | 84030c869b77f097b5b18f47c9eabc692022a02b /drivers/net/phy | |
parent | 1a6610de8c1bf45b83f0e99ee01e604045c1e10b (diff) | |
download | linux-639dab36edbdb186dad9dad40750723a4f820873.tar.xz |
sfp: fix non-detection of PHY
[ Upstream commit 20b56ed9f8adfb9a7fb1c878878c54aa4ed645c1 ]
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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/phy')
-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 ddf184db9c45..3165bc7b8e1e 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -318,12 +318,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; } |