Skip to contentSkip to conversation

net: phy: smsc: use phy_set_bits in smsc_phy_config_init

PATCH Applied Heiner Kallweit 3 participants 3 messages Mar 8, 2023 – Mar 10, 2023

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 1/1 net: phy: smsc: use phy_set_bits in smsc_phy_config_init

Simplify the code by using phy_set_bits().

---
 drivers/net/phy/smsc.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/net/phy/smsc.c +3 -10
index 5965a8afa..630104c16 100644
@@ -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)
Signature · 1 line
2.39.2
#2 lore raw
In reply to Heiner Kallweit
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 6 lines · On Wed, 8 Mar 2023 21:19:55 +0100 you wrote:

Simplify the code by using phy_set_bits().

---
 drivers/net/phy/smsc.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

Here is the summary with links:
- [net-next] net: phy: smsc: use phy_set_bits in smsc_phy_config_init

    https://git.kernel.org/netdev/net-next/c/513bdd947388

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html