lkml.org 
[lkml]   [2018]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] gpio-poweroff: Use gpiod_set_value_cansleep
Hi Mike,

On Tue, Apr 24, 2018 at 01:10:30PM +0200, Mike Looijmans wrote:
> 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>
> ---

Thanks, queued.

-- Sebastian

> drivers/power/reset/gpio-poweroff.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/reset/gpio-poweroff.c b/drivers/power/reset/gpio-poweroff.c
> index 6273ad3..38206c3 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);
> --
> 1.9.1
>
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-04-25 23:12    [W:0.083 / U:7.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site