Skip to contentSkip to conversation

power: fan53555: fix fan53555_regulator_set_value

PATCH New Vasily Khoruzhick 2 participants 2 messages Nov 17, 2019 – Nov 20, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: fan53555: fix fan53555_regulator_set_value

fan53555_regulator_set_value() passes its own dev to pmic_clrsetbits() instead of its parent (pmic). As result u-boot crashes when you try to set voltage on fan53555 regulator

---
 drivers/power/regulator/fan53555.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/regulator/fan53555.c +1 -1
index 9c48b26216..24a9b67586 100644
@@ -159,7 +159,7 @@ static int fan53555_regulator_set_value(struct udevice *dev, int uV)
 	debug("%s: uV=%d; writing volume %d: %02x\n",
 	      __func__, uV, pdata->vol_reg, vol);
 
-	return pmic_clrsetbits(dev, pdata->vol_reg, GENMASK(6, 0), vol);
+	return pmic_clrsetbits(dev->parent, pdata->vol_reg, GENMASK(6, 0), vol);
 }
 
 static int fan53555_voltages_setup(struct udevice *dev)
Signature · 1 line
2.24.0
#1 lore raw

PATCH 1/1 power: fan53555: fix fan53555_regulator_set_value

Quoted 5 lines · Vasily Khoruzhick

fan53555_regulator_set_value() passes its own dev to pmic_clrsetbits() instead of its parent (pmic). As result u-boot crashes when you try to set voltage on fan53555 regulator

Thanks,
- Kever

Quoted 17 lines
---
  drivers/power/regulator/fan53555.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/regulator/fan53555.c +1 -1
index 9c48b26216..24a9b67586 100644
@@ -159,7 +159,7 @@ static int fan53555_regulator_set_value(struct udevice *dev, int uV)
  	debug("%s: uV=%d; writing volume %d: %02x\n",
  	      __func__, uV, pdata->vol_reg, vol);
 
-	return pmic_clrsetbits(dev, pdata->vol_reg, GENMASK(6, 0), vol);
+	return pmic_clrsetbits(dev->parent, pdata->vol_reg, GENMASK(6, 0), vol);
  }
 
  static int fan53555_voltages_setup(struct udevice *dev)