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

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: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1af9f168
......@@ -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)
......
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