Commit d56417ad authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller
Browse files

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: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 89946e31
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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)