lkml.org 
[lkml]   [2018]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 4.15 38/78] sfp: fix non-detection of PHY
    Date
    From: Russell King <rmk+kernel@armlinux.org.uk>

    [ 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>
    ---
    drivers/net/phy/sfp.c | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
    index dec35888c429..10b77ac781ca 100644
    --- a/drivers/net/phy/sfp.c
    +++ b/drivers/net/phy/sfp.c
    @@ -315,12 +315,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;
    }

    --
    2.14.1
    \
     
     \ /
      Last update: 2018-03-08 08:04    [W:4.219 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site