net: phy: marvell10g: use genphy_c45_check_and_restart_aneg in mv3310_config_aneg

Use new function genphy_c45_check_and_restart_aneg() to reduce
boilerplate code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Heiner Kallweit 2019-02-18 21:27:46 +01:00 committed by David S. Miller
parent 1af9f16840
commit 6b4cb6cb13
1 changed files with 1 additions and 14 deletions

View File

@ -288,20 +288,7 @@ static int mv3310_config_aneg(struct phy_device *phydev)
if (ret > 0)
changed = true;
if (!changed) {
/* Configure and restart aneg if it wasn't set before */
ret = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1);
if (ret < 0)
return ret;
if (!(ret & MDIO_AN_CTRL1_ENABLE))
changed = 1;
}
if (changed)
ret = genphy_c45_restart_aneg(phydev);
return ret;
return genphy_c45_check_and_restart_aneg(phydev, changed);
}
static int mv3310_aneg_done(struct phy_device *phydev)