2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 09:13:55 +08:00

regulator: max8649: Use DIV_ROUND_UP macro to calculate selector

Use DIV_ROUND_UP macro for better readability.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Axel Lin 2012-03-08 10:05:24 +08:00 committed by Mark Brown
parent f08f5de54f
commit 21c9e5f19e

View File

@ -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;