All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel 3.14.28/gpiolib: Return GPIO logical value, not true value
@ 2015-05-20 15:54 Gary Thomas
  2015-05-20 16:34 ` Otavio Salvador
  0 siblings, 1 reply; 16+ messages in thread
From: Gary Thomas @ 2015-05-20 15:54 UTC (permalink / raw)
  To: meta-freescale; +Cc: Gary Thomas

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@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



^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-06-17 13:54 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-20 15:54 [PATCH] kernel 3.14.28/gpiolib: Return GPIO logical value, not true value Gary Thomas
2015-05-20 16:34 ` Otavio Salvador
2015-05-20 16:40   ` Gary Thomas
2015-05-20 16:42     ` Otavio Salvador
2015-05-20 16:49   ` Eric Bénard
2015-05-20 16:51     ` Gary Thomas
2015-05-20 16:52       ` Fabio Estevam
2015-05-20 16:57       ` Eric Bénard
2015-05-20 17:02         ` Fabio Estevam
2015-05-20 17:14           ` Gary Thomas
2015-05-20 17:26             ` Otavio Salvador
2015-05-20 17:34               ` Gary Thomas
2015-05-20 17:36                 ` Otavio Salvador
2015-05-20 17:49                   ` Fabio Estevam
2015-06-17 13:54                     ` Otavio Salvador
2015-05-20 17:26           ` Otavio Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.