Skip to content

Commit

Permalink
regulator: da9052: set_current_limit should select the maximum curren…
Browse files Browse the repository at this point in the history
…t in specific range

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 Aug 28, 2012
1 parent 4e1d67e commit 19d23c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/regulator/da9052-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ static int da9052_dcdc_set_current_limit(struct regulator_dev *rdev, int min_uA,
max_uA < da9052_current_limits[row][DA9052_MIN_UA])
return -EINVAL;

for (i = 0; i < DA9052_CURRENT_RANGE; i++) {
if (min_uA <= da9052_current_limits[row][i]) {
for (i = DA9052_CURRENT_RANGE - 1; i >= 0; i--) {
if (da9052_current_limits[row][i] <= max_uA) {
reg_val = i;
break;
}
Expand Down

0 comments on commit 19d23c2

Please sign in to comment.