Skip to content

Commit

Permalink
gpio / ACPI: use *_cansleep version of gpiod_get/set APIs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Aaron Lu authored and Linus Walleij committed May 23, 2014
1 parent 7b42e3d commit dc62b56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpio/gpiolib-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit dc62b56

Please sign in to comment.