Skip to content

Commit

Permalink
regulator: gpio-regulator: gpio_set_value should use cansleep
Browse files Browse the repository at this point in the history
If it's possible for gpio_set_value to sleep, we should be using
the *_cansleep call instead. This patch fixes multiple warnings
from gpiolib.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Lee Jones authored and Mark Brown committed Dec 10, 2012
1 parent ad0b8b9 commit 3708903
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/regulator/gpio-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static int gpio_regulator_set_voltage(struct regulator_dev *dev,

for (ptr = 0; ptr < data->nr_gpios; ptr++) {
state = (target & (1 << ptr)) >> ptr;
gpio_set_value(data->gpios[ptr].gpio, state);
gpio_set_value_cansleep(data->gpios[ptr].gpio, state);
}
data->state = target;

Expand Down Expand Up @@ -119,7 +119,7 @@ static int gpio_regulator_set_current_limit(struct regulator_dev *dev,

for (ptr = 0; ptr < data->nr_gpios; ptr++) {
state = (target & (1 << ptr)) >> ptr;
gpio_set_value(data->gpios[ptr].gpio, state);
gpio_set_value_cansleep(data->gpios[ptr].gpio, state);
}
data->state = target;

Expand Down

0 comments on commit 3708903

Please sign in to comment.