Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d506a5a authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

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

parent d770e558
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -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
	 * Force uV to be an allowed set point by applying a ceiling function to
	 * the uV value.
	 * the uV value.
	 */
	 */
	*voltage_sel = (uV - range->min_uV + range->step_uV - 1)
	*voltage_sel = DIV_ROUND_UP(uV - range->min_uV, range->step_uV);
			/ range->step_uV;
	uV = *voltage_sel * range->step_uV + range->min_uV;
	uV = *voltage_sel * range->step_uV + range->min_uV;


	if (uV > max_uV) {
	if (uV > max_uV) {