提交 419d06a1 编写于 作者: A Axel Lin 提交者: Mark Brown

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: NAxel Lin <axel.lin@ingics.com>
Acked-by: NStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 9b2dfee3
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部