Commit 9b01c885 authored by Oleksij Rempel's avatar Oleksij Rempel Committed by David S. Miller

net: phy: c22: migrate to genphy_c45_write_eee_adv()

Migrate from genphy_config_eee_advert() to genphy_c45_write_eee_adv().

It should work as before except write operation to the EEE adv registers
will be done only if some EEE abilities was detected.

If some driver will have a regression, related driver should provide own
.get_features callback. See micrel.c:ksz9477_get_features() as example.
Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 022c3f87
...@@ -2231,7 +2231,10 @@ int __genphy_config_aneg(struct phy_device *phydev, bool changed) ...@@ -2231,7 +2231,10 @@ int __genphy_config_aneg(struct phy_device *phydev, bool changed)
{ {
int err; int err;
if (genphy_config_eee_advert(phydev)) err = genphy_c45_write_eee_adv(phydev, phydev->supported_eee);
if (err < 0)
return err;
else if (err)
changed = true; changed = true;
err = genphy_setup_master_slave(phydev); err = genphy_setup_master_slave(phydev);
...@@ -2653,6 +2656,11 @@ int genphy_read_abilities(struct phy_device *phydev) ...@@ -2653,6 +2656,11 @@ int genphy_read_abilities(struct phy_device *phydev)
phydev->supported, val & ESTATUS_1000_XFULL); phydev->supported, val & ESTATUS_1000_XFULL);
} }
/* This is optional functionality. If not supported, we may get an error
* which should be ignored.
*/
genphy_c45_read_eee_abilities(phydev);
return 0; return 0;
} }
EXPORT_SYMBOL(genphy_read_abilities); EXPORT_SYMBOL(genphy_read_abilities);
......
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