summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8649.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/max8649.c')
-rw-r--r--drivers/regulator/max8649.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c
index d0e1180ad961..824c650436ed 100644
--- a/drivers/regulator/max8649.c
+++ b/drivers/regulator/max8649.c
@@ -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;
@@ -270,7 +269,7 @@ static int __devinit max8649_regulator_probe(struct i2c_client *client,
ret);
goto out;
}
- dev_info(info->dev, "Detected MAX8649 (ID:%x)\n", ret);
+ dev_info(info->dev, "Detected MAX8649 (ID:%x)\n", val);
/* enable VID0 & VID1 */
regmap_update_bits(info->regmap, MAX8649_CONTROL, MAX8649_VID_MASK, 0);