regulator: qcom_spmi-regulator: Use DIV_ROUND_UP instead of open-coded

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Axel Lin 2015-07-09 16:48:50 +08:00 committed by Mark Brown
parent d770e558e2
commit 5d506a5ad4
1 changed files with 1 additions and 2 deletions

View File

@ -504,8 +504,7 @@ static int spmi_regulator_select_voltage(struct spmi_regulator *vreg,
* Force uV to be an allowed set point by applying a ceiling function to
* the uV value.
*/
*voltage_sel = (uV - range->min_uV + range->step_uV - 1)
/ range->step_uV;
*voltage_sel = DIV_ROUND_UP(uV - range->min_uV, range->step_uV);
uV = *voltage_sel * range->step_uV + range->min_uV;
if (uV > max_uV) {