mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 21:53:44 +00:00
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> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9f4bae704f
commit
b5abac2d2d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user