aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/helpers.c')
-rw-r--r--drivers/regulator/helpers.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/regulator/helpers.c b/drivers/regulator/helpers.c
index 6e30df14714b..e221a271ba56 100644
--- a/drivers/regulator/helpers.c
+++ b/drivers/regulator/helpers.c
@@ -284,9 +284,13 @@ int regulator_map_voltage_linear_range(struct regulator_dev *rdev,
284 } 284 }
285 285
286 for (i = 0; i < rdev->desc->n_linear_ranges; i++) { 286 for (i = 0; i < rdev->desc->n_linear_ranges; i++) {
287 int linear_max_uV;
288
287 range = &rdev->desc->linear_ranges[i]; 289 range = &rdev->desc->linear_ranges[i];
290 linear_max_uV = range->min_uV +
291 (range->max_sel - range->min_sel) * range->uV_step;
288 292
289 if (!(min_uV <= range->max_uV && max_uV >= range->min_uV)) 293 if (!(min_uV <= linear_max_uV && max_uV >= range->min_uV))
290 continue; 294 continue;
291 295
292 if (min_uV <= range->min_uV) 296 if (min_uV <= range->min_uV)