summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/smsc.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2023-03-08 21:19:55 +0100
committerJakub Kicinski <kuba@kernel.org>2023-03-10 08:17:30 +0100
commit513bdd9473888ba4b1441923c2711cb5ecd06cfd (patch)
tree1d53c650fa7f80e446336f093f3e8c774505b861 /drivers/net/phy/smsc.c
parentnetlink: remove unused 'compare' function (diff)
downloadlinux-513bdd9473888ba4b1441923c2711cb5ecd06cfd.tar.xz
linux-513bdd9473888ba4b1441923c2711cb5ecd06cfd.zip
net: phy: smsc: use phy_set_bits in smsc_phy_config_init
Simplify the code by using phy_set_bits(). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Link: https://lore.kernel.org/r/b64d9f86-d029-b911-bbe9-6ca6889399d7@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/phy/smsc.c')
-rw-r--r--drivers/net/phy/smsc.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index feb6ac3939ac..ac951d67edcc 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -99,20 +99,13 @@ static irqreturn_t smsc_phy_handle_interrupt(struct phy_device *phydev)
static int smsc_phy_config_init(struct phy_device *phydev)
{
struct smsc_phy_priv *priv = phydev->priv;
- int rc;
if (!priv->energy_enable || phydev->irq != PHY_POLL)
return 0;
- rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
-
- if (rc < 0)
- return rc;
-
- /* Enable energy detect mode for this SMSC Transceivers */
- rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS,
- rc | MII_LAN83C185_EDPWRDOWN);
- return rc;
+ /* Enable energy detect power down mode */
+ return phy_set_bits(phydev, MII_LAN83C185_CTRL_STATUS,
+ MII_LAN83C185_EDPWRDOWN);
}
static int smsc_phy_reset(struct phy_device *phydev)