Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310648
b: refs/heads/master
c: 0092636
h: refs/heads/master
v: v3
  • Loading branch information
Heiko Stübner authored and Mark Brown committed Jun 4, 2012
1 parent f174393 commit dabc702
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d4be2f5ad223942577c2319153b86592f3da5b2
refs/heads/master: 00926369b745fb0c1e5c27cec35f6adc9752f2c4
6 changes: 4 additions & 2 deletions trunk/drivers/regulator/gpio-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,15 @@ static int gpio_regulator_set_value(struct regulator_dev *dev,
int min, int max)
{
struct gpio_regulator_data *data = rdev_get_drvdata(dev);
int ptr, target, state, best_val = INT_MAX;
int ptr, target = 0, state, best_val = INT_MAX;

for (ptr = 0; ptr < data->nr_states; ptr++)
if (data->states[ptr].value < best_val &&
data->states[ptr].value >= min &&
data->states[ptr].value <= max)
data->states[ptr].value <= max) {
target = data->states[ptr].gpios;
best_val = data->states[ptr].value;
}

if (best_val == INT_MAX)
return -EINVAL;
Expand Down

0 comments on commit dabc702

Please sign in to comment.