summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/smsc.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2023-04-02 17:13:05 +0200
committerDavid S. Miller <davem@davemloft.net>2023-04-03 11:08:42 +0200
commitd56417ad1133fc41752bb9fe37da7ae3187395a4 (patch)
tree6cc5905f223d08b79de767c33e86f7fd3c8929a9 /drivers/net/phy/smsc.c
parentnet: phy: smsc: add helper smsc_phy_config_edpd (diff)
downloadlinux-d56417ad1133fc41752bb9fe37da7ae3187395a4.tar.xz
linux-d56417ad1133fc41752bb9fe37da7ae3187395a4.zip
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 <hkallweit1@gmail.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/smsc.c')
-rw-r--r--drivers/net/phy/smsc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index 1b588366e075..f5ecd8bea0e3 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)