gpio / ACPI: use *_cansleep version of gpiod_get/set APIs
authorAaron Lu <aaron.lu@intel.com>
Tue, 20 May 2014 09:07:38 +0000 (17:07 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 23 May 2014 12:36:24 +0000 (14:36 +0200)
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>
drivers/gpio/gpiolib-acpi.c

index 401add28933f4f6f39c70b626e081ec39aef554b..4a987917c1862279756e844e58db98bad38dbdd7 100644 (file)
@@ -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: