提交 dbb48e7c 编写于 作者: T Tushar Behera 提交者: Liam Girdwood

regulator: MAX8997: Fix for divide by zero error

Currently, ramp_delay variable is used uninitialzed in
max8997_set_voltage_ldobuck which gets called through
regulator_register calls.

To fix the problem, in max8997_pmic_probe, ramp_delay initialization
code is moved before calls to regulator_register.

Cc: Liam Girdwood <lrg@ti.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: NTushar Behera <tushar.behera@linaro.org>
Acked-by: NMyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
上级 e2cf3137
......@@ -1124,6 +1124,10 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev)
0x3f);
}
/* Misc Settings */
max8997->ramp_delay = 10; /* set 10mV/us, which is the default */
max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9);
for (i = 0; i < pdata->num_regulators; i++) {
const struct voltage_map_desc *desc;
int id = pdata->regulators[i].id;
......@@ -1148,10 +1152,6 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev)
}
}
/* Misc Settings */
max8997->ramp_delay = 10; /* set 10mV/us, which is the default */
max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9);
return 0;
err:
for (i = 0; i < max8997->num_regulators; i++)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册