提交 21c9e5f1 编写于 作者: A Axel Lin 提交者: Mark Brown

regulator: max8649: Use DIV_ROUND_UP macro to calculate selector

Use DIV_ROUND_UP macro for better readability.
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 f08f5de5
...@@ -101,8 +101,7 @@ static int max8649_set_voltage(struct regulator_dev *rdev, ...@@ -101,8 +101,7 @@ static int max8649_set_voltage(struct regulator_dev *rdev,
min_uV, max_uV); min_uV, max_uV);
return -EINVAL; return -EINVAL;
} }
data = (min_uV - MAX8649_DCDC_VMIN + MAX8649_DCDC_STEP - 1) data = DIV_ROUND_UP(min_uV - MAX8649_DCDC_VMIN, MAX8649_DCDC_STEP);
/ MAX8649_DCDC_STEP;
mask = MAX8649_VOL_MASK; mask = MAX8649_VOL_MASK;
*selector = data & mask; *selector = data & mask;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册