Skip to contentSkip to conversation

mfd: lm3533-core: Fix calling regmap_update_bits() with mask and val arguments swapped

PATCH In review Axel Lin 3 participants 3 messages May 10, 2012 – May 11, 2012 Multifunction devices (MFD)

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mfd: lm3533-core: Fix calling regmap_update_bits() with mask and val arguments swapped

Current code calls regmap_update_bits() with mask and val arguments swapped. Fix it.

---
 drivers/mfd/lm3533-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mfd/lm3533-core.c +1 -1
index 75f4b7f..4a006c2 100644
@@ -128,7 +128,7 @@ int lm3533_update(struct lm3533 *lm3533, u8 reg, u8 val, u8 mask)
 
 	dev_dbg(lm3533->dev, "update [%02x]: %02x/%02x\n", reg, val, mask);
 
-	ret = regmap_update_bits(lm3533->regmap, reg, val, mask);
+	ret = regmap_update_bits(lm3533->regmap, reg, mask, val);
 	if (ret < 0) {
 		dev_err(lm3533->dev, "failed to update register %02x: %d\n",
 								reg, ret);
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 4 lines · Axel Lin

Current code calls regmap_update_bits() with mask and val arguments swapped. Fix it.

Quoted 1 line

---

Ouch, I was sure I'd fixed that in the submitted v2.

/Johan

Quoted 16 lines
 drivers/mfd/lm3533-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mfd/lm3533-core.c +1 -1
index 75f4b7f..4a006c2 100644
@@ -128,7 +128,7 @@ int lm3533_update(struct lm3533 *lm3533, u8 reg, u8 val, u8 mask)
 
 	dev_dbg(lm3533->dev, "update [%02x]: %02x/%02x\n", reg, val, mask);
 
-	ret = regmap_update_bits(lm3533->regmap, reg, val, mask);
+	ret = regmap_update_bits(lm3533->regmap, reg, mask, val);
 	if (ret < 0) {
 		dev_err(lm3533->dev, "failed to update register %02x: %d\n",
 								reg, ret);
#2 lore raw

Hi Johan, Axel,

Quoted 7 lines · Johan Hovold
Quoted 4 lines · Axel Lin

Current code calls regmap_update_bits() with mask and val arguments swapped. Fix it.

Rather Acked-by.
I applied this patch.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/