regulator: gpio-regulator: gpio_set_value should use cansleep
authorLee Jones <lee.jones@linaro.org>
Mon, 10 Dec 2012 08:55:53 +0000 (08:55 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 10 Dec 2012 14:12:41 +0000 (23:12 +0900)
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>
drivers/regulator/gpio-regulator.c

index 84e585fca7952c50b5d7bbd976bf06f6e846b26f..9f40b0df68cb1e7aceb89cb60b7b0a1b259debe3 100644 (file)
@@ -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;
 
@@ -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;