diff options
author | Aaron Lu <aaron.lu@intel.com> | 2014-05-20 05:07:38 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-05-23 08:36:24 -0400 |
commit | dc62b56a68d3d6dd1044e1f7d0c8310339cb5b5f (patch) | |
tree | bfb3aed6c695b9485c089b9411d441b30b2febe1 /drivers/gpio | |
parent | 7b42e3dbdafcc0454ffbce0a88b6d3f456e70d85 (diff) |
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 <aaron.lu@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpiolib-acpi.c | 5 |
1 files changed, 3 insertions, 2 deletions
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, | |||
449 | mutex_unlock(&achip->conn_lock); | 449 | mutex_unlock(&achip->conn_lock); |
450 | 450 | ||
451 | if (function == ACPI_WRITE) | 451 | if (function == ACPI_WRITE) |
452 | gpiod_set_raw_value(desc, !!((1 << i) & *value)); | 452 | gpiod_set_raw_value_cansleep(desc, |
453 | !!((1 << i) & *value)); | ||
453 | else | 454 | else |
454 | *value |= (u64)gpiod_get_raw_value(desc) << i; | 455 | *value |= (u64)gpiod_get_raw_value_cansleep(desc) << i; |
455 | } | 456 | } |
456 | 457 | ||
457 | out: | 458 | out: |