Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 84D34E00982; Wed, 20 May 2015 08:54:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail.chez-thomas.org (mail.mlbassoc.com [65.100.170.105]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 18A63E004F6 for ; Wed, 20 May 2015 08:54:06 -0700 (PDT) Received: by mail.chez-thomas.org (Postfix, from userid 1998) id 21F73F811E9; Wed, 20 May 2015 09:54:06 -0600 (MDT) Received: from Zeus.chez-thomas.org (zeus [192.168.1.114]) by mail.chez-thomas.org (Postfix) with ESMTP id 8E5ADF811E8; Wed, 20 May 2015 09:54:05 -0600 (MDT) From: Gary Thomas To: meta-freescale@yoctoproject.org Date: Wed, 20 May 2015 09:54:13 -0600 Message-Id: <1432137253-5312-1-git-send-email-gary@mlbassoc.com> X-Mailer: git-send-email 1.9.1 Cc: Gary Thomas Subject: [PATCH] kernel 3.14.28/gpiolib: Return GPIO logical value, not true value X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2015 15:54:13 -0000 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 --- 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