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 <axel.lin@ingics.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Axel Lin 2015-06-18 08:50:39 +08:00 committed by Mark Brown
parent 9b2dfee395
commit 419d06a1cf
1 changed files with 1 additions and 1 deletions

View File

@ -1106,7 +1106,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;