summaryrefslogtreecommitdiff
path: root/drivers/net/phy/sfp.c
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2022-10-21 16:09:59 +0100
committerJakub Kicinski <kuba@kernel.org>2022-10-24 21:06:16 -0700
commit398900498485fa9465386454681763d81efaad25 (patch)
tree7ce33631bdaebb018cc4f619fe64b5260b7257d0 /drivers/net/phy/sfp.c
parentf8810ca7582933e436e6c987808bbcc14f5543df (diff)
net: sfp: provide a definition for the power level select bit
Provide a named definition for the power level select bit in the extended status register, rather than using BIT(0) in the code. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/phy/sfp.c')
-rw-r--r--drivers/net/phy/sfp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index af676e28ba6a..16bce0ea68d9 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -1837,13 +1837,13 @@ static int sfp_sm_mod_hpower(struct sfp *sfp, bool enable)
* all bytes 0xff) at 0x51 but does not accept writes. In any case,
* if the bit is already set, we're already in high power mode.
*/
- if (!!(val & BIT(0)) == enable)
+ if (!!(val & SFP_EXT_STATUS_PWRLVL_SELECT) == enable)
return 0;
if (enable)
- val |= BIT(0);
+ val |= SFP_EXT_STATUS_PWRLVL_SELECT;
else
- val &= ~BIT(0);
+ val &= ~SFP_EXT_STATUS_PWRLVL_SELECT;
err = sfp_write(sfp, true, SFP_EXT_STATUS, &val, sizeof(val));
if (err != sizeof(val)) {