Skip to content

Commit

Permalink
regulator: qcom_spmi: Fix calculating number of voltages
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Mark Brown committed Jun 19, 2015
1 parent 9b2dfee commit 419d06a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/qcom_spmi-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 419d06a

Please sign in to comment.