mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-11 15:14:03 +08:00
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:
parent
d770e558e2
commit
5d506a5ad4
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user