Skip to content

Commit

Permalink
regulator: max8649: Use DIV_ROUND_UP macro to calculate selector
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Mark Brown committed Mar 11, 2012
1 parent f08f5de commit 21c9e5f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/regulator/max8649.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 21c9e5f

Please sign in to comment.