From d56417ad1133fc41752bb9fe37da7ae3187395a4 Mon Sep 17 00:00:00 2001 From: Heiner Kallweit Date: Sun, 2 Apr 2023 17:13:05 +0200 Subject: [PATCH] net: phy: smsc: clear edpd_enable if interrupt mode is used Clear edpd_enable if interupt mode is used, this avoids having to check for PHY_POLL multiple times. Signed-off-by: Heiner Kallweit Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- drivers/net/phy/smsc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index 1b58836..f5ecd8b 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c @@ -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) -- 2.7.4