Skip to content

Commit 28e219a

Browse files
giuliobenettikuba-moo
authored andcommitted
net: phy: broadcom: drop brcm_phy_setbits() and use phy_set_bits() instead
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: Simon Horman <simon.horman@corigine.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20230622184721.24368-1-giulio.benetti@benettiengineering.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent a685d0d commit 28e219a

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

drivers/net/phy/broadcom.c

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -664,17 +664,6 @@ static int bcm54616s_read_status(struct phy_device *phydev)
664664
return err;
665665
}
666666

667-
static int brcm_phy_setbits(struct phy_device *phydev, int reg, int set)
668-
{
669-
int val;
670-
671-
val = phy_read(phydev, reg);
672-
if (val < 0)
673-
return val;
674-
675-
return phy_write(phydev, reg, val | set);
676-
}
677-
678667
static int brcm_fet_config_init(struct phy_device *phydev)
679668
{
680669
int reg, err, err2, brcmtest;
@@ -745,15 +734,15 @@ static int brcm_fet_config_init(struct phy_device *phydev)
745734
goto done;
746735

747736
/* Enable auto MDIX */
748-
err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_MISCCTRL,
749-
MII_BRCM_FET_SHDW_MC_FAME);
737+
err = phy_set_bits(phydev, MII_BRCM_FET_SHDW_MISCCTRL,
738+
MII_BRCM_FET_SHDW_MC_FAME);
750739
if (err < 0)
751740
goto done;
752741

753742
if (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE) {
754743
/* Enable auto power down */
755-
err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2,
756-
MII_BRCM_FET_SHDW_AS2_APDE);
744+
err = phy_set_bits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2,
745+
MII_BRCM_FET_SHDW_AS2_APDE);
757746
}
758747

759748
done:

0 commit comments

Comments
 (0)