Skip to contentSkip to conversation

regulator: mpq7920: Fix Woverflow warning on conversion

PATCH Superseded Saravanan Sekar 1 participant 1 message Jan 10, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Saravanan Sekar

author maintainer
#0 lore raw

PATCH 1/1 regulator: mpq7920: Fix Woverflow warning on conversion

Fix warning Woverflow warning on type conversion reported on X86.

Fixes 6501c1f54a17 (regulator: mpq7920: add mpq7920 regulator driver)
---
 drivers/regulator/mpq7920.c | 2 +-
 drivers/regulator/mpq7920.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/regulator/mpq7920.c +1 -1
index c603d60fb87b..ab1b847c57e5 100644
@@ -221,7 +221,7 @@ static int mpq7920_parse_cb(struct device_node *np,
 	if (of_property_read_bool(np, "mps,buck-ovp-disable")) {
 		regmap_update_bits(config->regmap,
 				MPQ7920_BUCK1_REG_B + (rdesc->id * 4),
-				BIT(6), ~BIT(6));
+				MPQ7920_MASK_OVP, MPQ7920_OVP_DISABLE);
 	}
 
 	ret = of_property_read_u8(np, "mps,buck-phase-delay", &val);
drivers/regulator/mpq7920.h +2 -0
index 6a93bfbc750c..1498a1e3f4f5 100644
@@ -55,6 +55,8 @@
 #define MPQ7920_MASK_SWITCH_FREQ	0x30
 #define MPQ7920_MASK_BUCK_PHASE_DEALY	0x30
 #define MPQ7920_MASK_DVS_SLEWRATE	0xc0
+#define MPQ7920_MASK_OVP		0x40
+#define MPQ7920_OVP_DISABLE		~(0x40)
 #define MPQ7920_DISCHARGE_ON		0x1
 
 #define MPQ7920_REGULATOR_EN_OFFSET	7
Signature · 1 line
2.17.1