]> Git Repo - linux.git/commitdiff
net: phy: c22: migrate to genphy_c45_write_eee_adv()
authorOleksij Rempel <[email protected]>
Sat, 11 Feb 2023 07:41:10 +0000 (08:41 +0100)
committerDavid S. Miller <[email protected]>
Mon, 13 Feb 2023 11:12:31 +0000 (11:12 +0000)
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]>
drivers/net/phy/phy_device.c

index 66a4e62009bb573896b17964f77b61ce663fa77b..8d927c5e3bf8de76ee7229ae45b342934ab5baa7 100644 (file)
@@ -2231,7 +2231,10 @@ int __genphy_config_aneg(struct phy_device *phydev, bool changed)
 {
        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;
 
        err = genphy_setup_master_slave(phydev);
@@ -2653,6 +2656,11 @@ int genphy_read_abilities(struct phy_device *phydev)
                                 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;
 }
 EXPORT_SYMBOL(genphy_read_abilities);
This page took 0.052768 seconds and 4 git commands to generate.