diff options
author | Mike Looijmans <mike.looijmans@topic.nl> | 2018-04-24 14:10:30 +0300 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.co.uk> | 2018-04-26 00:05:59 +0300 |
commit | 77142a611252de84ac533842438d19e7b2f494e7 (patch) | |
tree | 44e40c567773892bbf00e43dacbce8d770fa95a6 /drivers/power/reset | |
parent | 6d08b06e67cd117f6992c46611dfb4ce267cd71e (diff) | |
download | linux-77142a611252de84ac533842438d19e7b2f494e7.tar.xz |
gpio-poweroff: Use gpiod_set_value_cansleep
The power-off call is done in a context that must be able to sleep, so
use gpiod_set_value_cansleep instead of the atomic gpiod_set_value call.
This fixes a kernel warning at shutdown when the gpio is controlled
through an IO expander for example.
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'drivers/power/reset')
-rw-r--r-- | drivers/power/reset/gpio-poweroff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/reset/gpio-poweroff.c b/drivers/power/reset/gpio-poweroff.c index 6273ad3b411d..38206c39b3bf 100644 --- a/drivers/power/reset/gpio-poweroff.c +++ b/drivers/power/reset/gpio-poweroff.c @@ -35,11 +35,11 @@ static void gpio_poweroff_do_poweroff(void) gpiod_direction_output(reset_gpio, 1); mdelay(100); /* drive inactive, also active->inactive edge */ - gpiod_set_value(reset_gpio, 0); + gpiod_set_value_cansleep(reset_gpio, 0); mdelay(100); /* drive it active, also inactive->active edge */ - gpiod_set_value(reset_gpio, 1); + gpiod_set_value_cansleep(reset_gpio, 1); /* give it some time */ mdelay(timeout); |