Commit 2d4284e8 authored by Luo Jie's avatar Luo Jie Committed by David S. Miller

net: phy: at803x: use phy_modify()

Convert at803x_set_wol to use phy_modify.
Signed-off-by: default avatarLuo Jie <luoj@codeaurora.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c0f0b563
...@@ -357,16 +357,12 @@ static int at803x_set_wol(struct phy_device *phydev, ...@@ -357,16 +357,12 @@ static int at803x_set_wol(struct phy_device *phydev,
phy_write_mmd(phydev, MDIO_MMD_PCS, offsets[i], phy_write_mmd(phydev, MDIO_MMD_PCS, offsets[i],
mac[(i * 2) + 1] | (mac[(i * 2)] << 8)); mac[(i * 2) + 1] | (mac[(i * 2)] << 8));
value = phy_read(phydev, AT803X_INTR_ENABLE); ret = phy_modify(phydev, AT803X_INTR_ENABLE, 0, AT803X_INTR_ENABLE_WOL);
value |= AT803X_INTR_ENABLE_WOL;
ret = phy_write(phydev, AT803X_INTR_ENABLE, value);
if (ret) if (ret)
return ret; return ret;
value = phy_read(phydev, AT803X_INTR_STATUS); value = phy_read(phydev, AT803X_INTR_STATUS);
} else { } else {
value = phy_read(phydev, AT803X_INTR_ENABLE); ret = phy_modify(phydev, AT803X_INTR_ENABLE, AT803X_INTR_ENABLE_WOL, 0);
value &= (~AT803X_INTR_ENABLE_WOL);
ret = phy_write(phydev, AT803X_INTR_ENABLE, value);
if (ret) if (ret)
return ret; return ret;
value = phy_read(phydev, AT803X_INTR_STATUS); value = phy_read(phydev, AT803X_INTR_STATUS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment