diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2019-02-18 21:27:46 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-21 22:03:06 +0100 |
commit | 6b4cb6cb1385337d72a2bc0bd3b264f54a7bfaae (patch) | |
tree | a66b3c9954b0fef11b85387eec518cb9f410c1b3 /drivers/net/phy/marvell10g.c | |
parent | net: phy: add genphy_c45_check_and_restart_aneg (diff) | |
download | linux-6b4cb6cb1385337d72a2bc0bd3b264f54a7bfaae.tar.xz linux-6b4cb6cb1385337d72a2bc0bd3b264f54a7bfaae.zip |
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>
Diffstat (limited to 'drivers/net/phy/marvell10g.c')
-rw-r--r-- | drivers/net/phy/marvell10g.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 9ea27acf05ad..586ae1bc5a50 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -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) |