[meta-freescale] [PATCH] kernel 3.14.28/gpiolib: Return GPIO logical value, not true value
Gary Thomas
gary at mlbassoc.com
Wed May 20 08:54:13 PDT 2015
Previous versions of the kernel returned the logical value of
GPIO signals (i.e. 0 or 1). This patch restores this behavior.
Signed-off-by: Gary Thomas <gary at mlbassoc.com>
---
drivers/gpio/gpiolib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 50c4922..45aa695 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -376,7 +376,7 @@ static ssize_t gpio_value_show(struct device *dev,
if (!test_bit(FLAG_EXPORT, &desc->flags))
status = -EIO;
else
- status = sprintf(buf, "%d\n", gpiod_get_value_cansleep(desc));
+ status = sprintf(buf, "%d\n", !!gpiod_get_value_cansleep(desc));
mutex_unlock(&sysfs_lock);
return status;
--
1.9.1
More information about the meta-freescale
mailing list