net: phy: smsc: clear edpd_enable if interrupt mode is used
authorHeiner Kallweit <hkallweit1@gmail.com>
Sun, 2 Apr 2023 15:13:05 +0000 (17:13 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Apr 2023 09:08:42 +0000 (10:08 +0100)
Clear edpd_enable if interupt mode is used, this avoids
having to check for PHY_POLL multiple times.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/smsc.c

index 1b58836..f5ecd8b 100644 (file)
@@ -114,9 +114,12 @@ int smsc_phy_config_init(struct phy_device *phydev)
 {
        struct smsc_phy_priv *priv = phydev->priv;
 
-       if (!priv || !priv->edpd_enable || phydev->irq != PHY_POLL)
+       if (!priv)
                return 0;
 
+       if (phydev->irq != PHY_POLL)
+               priv->edpd_enable = false;
+
        return smsc_phy_config_edpd(phydev);
 }
 EXPORT_SYMBOL_GPL(smsc_phy_config_init);
@@ -208,8 +211,7 @@ int lan87xx_read_status(struct phy_device *phydev)
        if (err)
                return err;
 
-       if (!phydev->link && priv && priv->edpd_enable &&
-           phydev->irq == PHY_POLL) {
+       if (!phydev->link && priv && priv->edpd_enable) {
                /* Disable EDPD to wake up PHY */
                int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
                if (rc < 0)