diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2019-11-26 12:25:48 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2020-01-27 10:33:28 +0000 |
commit | 2f089e99c8be5fa3207f26b0405d26cd14c15c72 (patch) | |
tree | 70a9e48f99f6a29b7db85b2130f34844d7e22874 | |
parent | b3ee7c35c38daa98869779ad6b82383cf692be72 (diff) |
net: phy: marvell: use genphy_check_and_restart_aneg()
Use the helper to check and restart autonegotiation for the marvell
fiber page negotiation setting.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | drivers/net/phy/marvell.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 7da64208365b..28e33ece4ce1 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -534,26 +534,7 @@ static int marvell_config_aneg_fiber(struct phy_device *phydev) if (err > 0) changed = 1; - if (changed == 0) { - /* Advertisement hasn't changed, but maybe aneg was never on to - * begin with? Or maybe phy was isolated? - */ - int ctl = phy_read(phydev, MII_BMCR); - - if (ctl < 0) - return ctl; - - if (!(ctl & BMCR_ANENABLE) || (ctl & BMCR_ISOLATE)) - changed = 1; /* do restart aneg */ - } - - /* Only restart aneg if we are advertising something different - * than we were before. - */ - if (changed > 0) - changed = genphy_restart_aneg(phydev); - - return changed; + return genphy_check_and_restart_aneg(phydev, changed); } static int m88e1510_config_aneg(struct phy_device *phydev) |