]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: phy: at803x: move disable WOL to specific at8031 probe
authorChristian Marangi <ansuelsmth@gmail.com>
Fri, 8 Dec 2023 14:51:49 +0000 (15:51 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Dec 2023 10:34:27 +0000 (10:34 +0000)
Move the WOL disable call to specific at8031 probe to make at803x_probe
more generic and drop extra check for PHY ID.

Keep the same previous behaviour by first calling at803x_probe and then
disabling WOL.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/at803x.c

index ef203b0807e588b69c1cfca1d81dfd30c0b35b89..b8f3c215d0e86138419d654e35c37987d6a623c3 100644 (file)
@@ -886,15 +886,6 @@ static int at803x_probe(struct phy_device *phydev)
                        priv->is_fiber = true;
                        break;
                }
-
-               /* Disable WoL in 1588 register which is enabled
-                * by default
-                */
-               ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
-                                    AT803X_PHY_MMD3_WOL_CTRL,
-                                    AT803X_WOL_EN, 0);
-               if (ret)
-                       return ret;
        }
 
        return 0;
@@ -1591,6 +1582,22 @@ static int at803x_cable_test_start(struct phy_device *phydev)
        return 0;
 }
 
+static int at8031_probe(struct phy_device *phydev)
+{
+       int ret;
+
+       ret = at803x_probe(phydev);
+       if (ret)
+               return ret;
+
+       /* Disable WoL in 1588 register which is enabled
+        * by default
+        */
+       return phy_modify_mmd(phydev, MDIO_MMD_PCS,
+                             AT803X_PHY_MMD3_WOL_CTRL,
+                             AT803X_WOL_EN, 0);
+}
+
 static int qca83xx_config_init(struct phy_device *phydev)
 {
        u8 switch_revision;
@@ -2092,7 +2099,7 @@ static struct phy_driver at803x_driver[] = {
        PHY_ID_MATCH_EXACT(ATH8031_PHY_ID),
        .name                   = "Qualcomm Atheros AR8031/AR8033",
        .flags                  = PHY_POLL_CABLE_TEST,
-       .probe                  = at803x_probe,
+       .probe                  = at8031_probe,
        .config_init            = at803x_config_init,
        .config_aneg            = at803x_config_aneg,
        .soft_reset             = genphy_soft_reset,