net: phy: disable aneg in genphy_c45_pma_setup_forced
authorHeiner Kallweit <hkallweit1@gmail.com>
Sat, 16 Feb 2019 19:44:16 +0000 (20:44 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Feb 2019 04:18:39 +0000 (20:18 -0800)
When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may
still be set, therefore clear it. This is also in line with what
genphy_setup_forced() does for Clause 22.

v2:
- fix typo

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy-c45.c

index 1cf5e8ae46deef6ce06db9ae0bf5be5f88822207..16636d49bd14b65f0ed871e55f76171aa8520947 100644 (file)
@@ -70,7 +70,11 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
        if (ret < 0)
                return ret;
 
-       return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2);
+       ret = phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2);
+       if (ret < 0)
+               return ret;
+
+       return genphy_c45_an_disable_aneg(phydev);
 }
 EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);