From: Aaron Lu Date: Tue, 20 May 2014 09:07:38 +0000 (+0800) Subject: gpio / ACPI: use *_cansleep version of gpiod_get/set APIs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dc62b56a68d3d6dd1044e1f7d0c8310339cb5b5f;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git gpio / ACPI: use *_cansleep version of gpiod_get/set APIs The GPIO operation region handler should be called where sleep is allowed, so we should use the *_cansleep version of gpiod_get/set APIs or we will get a warning message complaining invalid context if the GPIO chip has the cansleep flag set. Signed-off-by: Aaron Lu Acked-by: Mika Westerberg Acked-by: Alexandre Courbot Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 401add28933f..4a987917c186 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -449,9 +449,10 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, mutex_unlock(&achip->conn_lock); if (function == ACPI_WRITE) - gpiod_set_raw_value(desc, !!((1 << i) & *value)); + gpiod_set_raw_value_cansleep(desc, + !!((1 << i) & *value)); else - *value |= (u64)gpiod_get_raw_value(desc) << i; + *value |= (u64)gpiod_get_raw_value_cansleep(desc) << i; } out: