提交 77142a61 编写于 作者: M Mike Looijmans 提交者: Sebastian Reichel

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: NMike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
上级 6d08b06e
...@@ -35,11 +35,11 @@ static void gpio_poweroff_do_poweroff(void) ...@@ -35,11 +35,11 @@ static void gpio_poweroff_do_poweroff(void)
gpiod_direction_output(reset_gpio, 1); gpiod_direction_output(reset_gpio, 1);
mdelay(100); mdelay(100);
/* drive inactive, also active->inactive edge */ /* drive inactive, also active->inactive edge */
gpiod_set_value(reset_gpio, 0); gpiod_set_value_cansleep(reset_gpio, 0);
mdelay(100); mdelay(100);
/* drive it active, also inactive->active edge */ /* drive it active, also inactive->active edge */
gpiod_set_value(reset_gpio, 1); gpiod_set_value_cansleep(reset_gpio, 1);
/* give it some time */ /* give it some time */
mdelay(timeout); mdelay(timeout);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册