Skip to contentSkip to conversation

regulator: max77620: Fix regulator info setting for max20024

PATCH Superseded Axel Lin 1 participant 2 messages Feb 24, 2019 – Mar 21, 2019 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: max77620: Fix regulator info setting for max20024

Current code always set pmic->rinfo[id] = &max77620_regs_info[id]; It should set to either max77620_regs_info or max20024_regs_info depends on the chip_id.

---
 drivers/regulator/max77620-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/max77620-regulator.c +1 -1
index 1607ac673e44..0ad91a7f9cb9 100644
@@ -803,7 +803,7 @@ static int max77620_regulator_probe(struct platform_device *pdev)
 			continue;
 
 		rdesc = &rinfo[id].desc;
-		pmic->rinfo[id] = &max77620_regs_info[id];
+		pmic->rinfo[id] = &rinfo[id];
 		pmic->enable_power_mode[id] = MAX77620_POWER_MODE_NORMAL;
 		pmic->reg_pdata[id].active_fps_src = -1;
 		pmic->reg_pdata[id].active_fps_pd_slot = -1;
Signature · 1 line
2.17.1
author
#1 lore raw

Axel Lin <[email protected]> 於 2019年2月24日 週日 上午9:27寫道:

Quoted 15 lines

Current code always set pmic->rinfo[id] = &max77620_regs_info[id]; It should set to either max77620_regs_info or max20024_regs_info depends on the chip_id.

---
 drivers/regulator/max77620-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/max77620-regulator.c +0 -0
index 1607ac673e44..0ad91a7f9cb9 100644

drivers/regulator/max77620-regulator.c static int max77620_regulator_probe(struct platform_device *pdev) · line 806

Quoted 5 lines
drivers/regulator/max77620-regulator.c +1 -1
@@ -803,7 +803,7 @@ static int max77620_regulator_probe(struct platform_device *pdev)
                        continue;
 
                rdesc = &rinfo[id].desc;
-               pmic->rinfo[id] = &max77620_regs_info[id];
+               pmic->rinfo[id] = &rinfo[id];

I'm wondering if anyone can help review this patch.
This looks like a bug fix to me because for max20024 MAX77620_REGULATOR_ID_SD4, the pmic->rinfo[id] = &max77620_regs_info[id]; set pmic->rinfo[id] to a zero-filled entry.
e.g. In max77620_regulator_set_power_mode, rinfo->cfg_addr is wrong for MAX77620_REGULATOR_ID_SD4.

Thanks,
Axel