diff mbox series

[net-next] net: phy: smsc: use phy_set_bits in smsc_phy_config_init

Message ID b64d9f86-d029-b911-bbe9-6ca6889399d7@gmail.com (mailing list archive)
State Accepted
Commit 513bdd9473888ba4b1441923c2711cb5ecd06cfd
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: phy: smsc: use phy_set_bits in smsc_phy_config_init | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 20 this patch: 20
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 20 this patch: 20
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 23 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Heiner Kallweit March 8, 2023, 8:19 p.m. UTC
Simplify the code by using phy_set_bits().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/smsc.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

Comments

Simon Horman March 9, 2023, 2:33 p.m. UTC | #1
On Wed, Mar 08, 2023 at 09:19:55PM +0100, Heiner Kallweit wrote:
> Simplify the code by using phy_set_bits().
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>
patchwork-bot+netdevbpf@kernel.org March 10, 2023, 7:30 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 8 Mar 2023 21:19:55 +0100 you wrote:
> Simplify the code by using phy_set_bits().
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  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!
diff mbox series

Patch

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)