Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3708903e authored by Lee Jones's avatar Lee Jones Committed by Mark Brown
Browse files

regulator: gpio-regulator: gpio_set_value should use cansleep



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: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent ad0b8b9e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;