[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <b64d9f86-d029-b911-bbe9-6ca6889399d7@gmail.com>
Date: Wed, 8 Mar 2023 21:19:55 +0100
From: Heiner Kallweit <hkallweit1@...il.com>
To: Russell King - ARM Linux <linux@...linux.org.uk>,
Andrew Lunn <andrew@...n.ch>, Jakub Kicinski <kuba@...nel.org>,
David Miller <davem@...emloft.net>,
Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: [PATCH net-next] 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@...il.com>
---
drivers/net/phy/smsc.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index 5965a8afa..630104c16 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -107,20 +107,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)
--
2.39.2
Powered by blists - more mailing lists