Skip to content

Commit 5827b16

Browse files
oleremdavem330
authored andcommitted
net: phy: c45: 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: Oleksij Rempel <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9b01c88 commit 5827b16

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/net/phy/phy-c45.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,11 @@ int genphy_c45_an_config_aneg(struct phy_device *phydev)
262262
linkmode_and(phydev->advertising, phydev->advertising,
263263
phydev->supported);
264264

265-
changed = genphy_config_eee_advert(phydev);
265+
ret = genphy_c45_write_eee_adv(phydev, phydev->supported_eee);
266+
if (ret < 0)
267+
return ret;
268+
else if (ret)
269+
changed = true;
266270

267271
if (genphy_c45_baset1_able(phydev))
268272
return genphy_c45_baset1_an_config_aneg(phydev);
@@ -968,6 +972,11 @@ int genphy_c45_pma_read_abilities(struct phy_device *phydev)
968972
}
969973
}
970974

975+
/* This is optional functionality. If not supported, we may get an error
976+
* which should be ignored.
977+
*/
978+
genphy_c45_read_eee_abilities(phydev);
979+
971980
return 0;
972981
}
973982
EXPORT_SYMBOL_GPL(genphy_c45_pma_read_abilities);

0 commit comments

Comments
 (0)