mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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:
parent
1af9f16840
commit
6b4cb6cb13
1 changed files with 1 additions and 14 deletions
|
@ -288,20 +288,7 @@ static int mv3310_config_aneg(struct phy_device *phydev)
|
||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
changed = true;
|
changed = true;
|
||||||
|
|
||||||
if (!changed) {
|
return genphy_c45_check_and_restart_aneg(phydev, 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mv3310_aneg_done(struct phy_device *phydev)
|
static int mv3310_aneg_done(struct phy_device *phydev)
|
||||||
|
|
Loading…
Add table
Reference in a new issue