net: phy: use genphy_read_abilities in genphy driver
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 27 Mar 2019 20:59:33 +0000 (21:59 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Apr 2019 20:09:56 +0000 (13:09 -0700)
Currently the genphy driver populates phydev->supported like this:
First all possible feature bits are set, then genphy_config_init()
reads the available features from the chip and remove all unsupported
features from phydev->supported. This can be simplified by using
genphy_read_abilities().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c

index 0af66f32d36390725a3aa89f5c65f802d64a41e9..67fc581e359838da28bb5d6b4fd1ff21fbafbe39 100644 (file)
@@ -2284,8 +2284,7 @@ static struct phy_driver genphy_driver = {
        .phy_id_mask    = 0xffffffff,
        .name           = "Generic PHY",
        .soft_reset     = genphy_no_soft_reset,
-       .config_init    = genphy_config_init,
-       .features       = PHY_GBIT_ALL_PORTS_FEATURES,
+       .get_features   = genphy_read_abilities,
        .aneg_done      = genphy_aneg_done,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,