regulator: qcom_spmi: Fix calculating number of voltages
PATCH 1/1 regulator: qcom_spmi: Fix calculating number of voltages
n /= range->step_uV + 1; is equivalent to n /= (range->step_uV + 1); which is wrong. Fix it.
Signed-off-by Axel Lin <[email protected]>
--- drivers/regulator/qcom_spmi-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/qcom_spmi-regulator.c +1 -1
@@ -1108,7 +1108,7 @@ static void spmi_calculate_num_voltages(struct spmi_voltage_set_points *points) n =0 ;if (range->set_point_max_uV) { n = range->set_point_max_uV - range->set_point_min_uV; - n /= range->step_uV +1 ; + n = (n / range->step_uV) +1 ; } range->n_voltages = n; points->n_voltages += n;
Signature · 1 line
2.1.0
Quoted 5 lines · Axel Lin
n /=
range->step_uV+ 1; is equivalent to n /= (range->step_uV+ 1); which is wrong. Fix it.Signed-off-by Axel Lin <[email protected]>---
Acked-by Stephen Boyd <[email protected]>
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Quoted 2 lines · Axel Lin
n /=
range->step_uV+ 1; is equivalent to n /= (range->step_uV+ 1); which is wrong. Fix it.
Applied, thanks.