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

Commit 21c9e5f1 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

regulator: max8649: Use DIV_ROUND_UP macro to calculate selector



Use DIV_ROUND_UP macro for better readability.

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent f08f5de5
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -101,8 +101,7 @@ static int max8649_set_voltage(struct regulator_dev *rdev,
			min_uV, max_uV);
		return -EINVAL;
	}
	data = (min_uV - MAX8649_DCDC_VMIN + MAX8649_DCDC_STEP - 1)
		/ MAX8649_DCDC_STEP;
	data = DIV_ROUND_UP(min_uV - MAX8649_DCDC_VMIN, MAX8649_DCDC_STEP);
	mask = MAX8649_VOL_MASK;
	*selector = data & mask;