aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/regulator/max1586.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c
index 40e7a4db2853..282d2ee0604e 100644
--- a/drivers/regulator/max1586.c
+++ b/drivers/regulator/max1586.c
@@ -76,8 +76,8 @@ static int max1586_v3_set(struct regulator_dev *rdev, int min_uV, int max_uV,
76 if (min_uV < max1586->min_uV) 76 if (min_uV < max1586->min_uV)
77 min_uV = max1586->min_uV; 77 min_uV = max1586->min_uV;
78 78
79 *selector = ((min_uV - max1586->min_uV) * MAX1586_V3_MAX_VSEL + 79 *selector = DIV_ROUND_UP((min_uV - max1586->min_uV) *
80 range_uV - 1) / range_uV; 80 MAX1586_V3_MAX_VSEL, range_uV);
81 if (max1586_v3_calc_voltage(max1586, *selector) > max_uV) 81 if (max1586_v3_calc_voltage(max1586, *selector) > max_uV)
82 return -EINVAL; 82 return -EINVAL;
83 83