Commit b7f29f8c authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

net: phy: fix setting autoneg_complete in genphy_update_link

The original patch didn't set phydev->autoneg_complete in one exit path.
Fix this.

Fixes: 4950c2ba ("net: phy: fix autoneg mismatch case in genphy_read_status")
Reported-by: default avatarSimon Horman <horms@verge.net.au>
Tested-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 13ee7d49
...@@ -1710,19 +1710,17 @@ int genphy_update_link(struct phy_device *phydev) ...@@ -1710,19 +1710,17 @@ int genphy_update_link(struct phy_device *phydev)
*/ */
if (!phy_polling_mode(phydev)) { if (!phy_polling_mode(phydev)) {
status = phy_read(phydev, MII_BMSR); status = phy_read(phydev, MII_BMSR);
if (status < 0) { if (status < 0)
return status; return status;
} else if (status & BMSR_LSTATUS) { else if (status & BMSR_LSTATUS)
phydev->link = 1; goto done;
return 0;
}
} }
/* Read link and autonegotiation status */ /* Read link and autonegotiation status */
status = phy_read(phydev, MII_BMSR); status = phy_read(phydev, MII_BMSR);
if (status < 0) if (status < 0)
return status; return status;
done:
phydev->link = status & BMSR_LSTATUS ? 1 : 0; phydev->link = status & BMSR_LSTATUS ? 1 : 0;
phydev->autoneg_complete = status & BMSR_ANEGCOMPLETE ? 1 : 0; phydev->autoneg_complete = status & BMSR_ANEGCOMPLETE ? 1 : 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment