[net-next,v2] net: phy: broadcom: drop brcm_phy_setbits() and use phy_set_bits() instead

Message ID 20230622184721.24368-1-giulio.benetti@benettiengineering.com
State New
Headers
Series [net-next,v2] net: phy: broadcom: drop brcm_phy_setbits() and use phy_set_bits() instead |

Commit Message

Giulio Benetti June 22, 2023, 6:47 p.m. UTC
  Linux provides phy_set_bits() helper so let's drop brcm_phy_setbits() and
use phy_set_bits() in its place.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
V1->V2:
* fix code style and add branch net-next to subject as suggested by Simon
  Horman
---
 drivers/net/phy/broadcom.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)
  

Comments

Simon Horman June 23, 2023, 7:31 a.m. UTC | #1
On Thu, Jun 22, 2023 at 08:47:21PM +0200, Giulio Benetti wrote:
> Linux provides phy_set_bits() helper so let's drop brcm_phy_setbits() and
> use phy_set_bits() in its place.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
> V1->V2:
> * fix code style and add branch net-next to subject as suggested by Simon
>   Horman
> ---
>  drivers/net/phy/broadcom.c | 19 ++++---------------
>  1 file changed, 4 insertions(+), 15 deletions(-)

Reviewed-by: Simon Horman <simon.horman@corigine.com>
  
Florian Fainelli June 23, 2023, 9:25 a.m. UTC | #2
On 6/22/2023 7:47 PM, Giulio Benetti wrote:
> Linux provides phy_set_bits() helper so let's drop brcm_phy_setbits() and
> use phy_set_bits() in its place.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
  
patchwork-bot+netdevbpf@kernel.org June 24, 2023, 10:10 p.m. UTC | #3
Hello:

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

On Thu, 22 Jun 2023 20:47:21 +0200 you wrote:
> Linux provides phy_set_bits() helper so let's drop brcm_phy_setbits() and
> use phy_set_bits() in its place.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
> V1->V2:
> * fix code style and add branch net-next to subject as suggested by Simon
>   Horman
> 
> [...]

Here is the summary with links:
  - [net-next,v2] net: phy: broadcom: drop brcm_phy_setbits() and use phy_set_bits() instead
    https://git.kernel.org/netdev/net-next/c/28e219aea0b9

You are awesome, thank you!
  

Patch

diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index e81868d1830b..38a6615deaf7 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -608,17 +608,6 @@  static int bcm54616s_read_status(struct phy_device *phydev)
 	return err;
 }
 
-static int brcm_phy_setbits(struct phy_device *phydev, int reg, int set)
-{
-	int val;
-
-	val = phy_read(phydev, reg);
-	if (val < 0)
-		return val;
-
-	return phy_write(phydev, reg, val | set);
-}
-
 static int brcm_fet_config_init(struct phy_device *phydev)
 {
 	int reg, err, err2, brcmtest;
@@ -689,15 +678,15 @@  static int brcm_fet_config_init(struct phy_device *phydev)
 		goto done;
 
 	/* Enable auto MDIX */
-	err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_MISCCTRL,
-				       MII_BRCM_FET_SHDW_MC_FAME);
+	err = phy_set_bits(phydev, MII_BRCM_FET_SHDW_MISCCTRL,
+			   MII_BRCM_FET_SHDW_MC_FAME);
 	if (err < 0)
 		goto done;
 
 	if (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE) {
 		/* Enable auto power down */
-		err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2,
-					       MII_BRCM_FET_SHDW_AS2_APDE);
+		err = phy_set_bits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2,
+				   MII_BRCM_FET_SHDW_AS2_APDE);
 	}
 
 done: