lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <2f2b55523b707d514a15d822ff812cfae654510a.1330079584.git.viresh.kumar@st.com>
Date:	Fri, 24 Feb 2012 16:04:39 +0530
From:	Viresh Kumar <viresh.kumar@...com>
To:	<grant.likely@...retlab.ca>, <linus.walleij@...ricsson.com>,
	<rabin@....in>
Cc:	<linux-kernel@...r.kernel.org>, <armando.visconti@...com>,
	<shiraz.hashim@...com>, <vipin.kumar@...com>,
	<rajeev-dlh.kumar@...com>, <deepak.sikri@...com>,
	<vipulkumar.samar@...com>, <amit.virdi@...com>,
	<viresh.kumar@...com>, <pratyush.anand@...com>,
	<bhupesh.sharma@...com>, <viresh.linux@...il.com>,
	<bhavna.yadav@...com>, <vincenzo.frascino@...com>,
	<mirko.gardi@...com>, <salvatore.dedominicis@...com>
Subject: [PATCH] gpio/gpio-stmpe: Fix the value returned by _get_value routine

From: Bhupesh Sharma <bhupesh.sharma@...com>

The present _get_value routine returns the contents of the GPIO
Monitor Pin Status Register(GPMR) starting from the bit whose value
is requested to BIT 0.

For e.g. if we request the value of GPIO 6 in the earlier
implementation the value returned is:

	BIT6 to BIT0

whereas it should just return BIT6.

This patch addresses the same.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@...com>
Reviewed-by: Viresh Kumar <viresh.kumar@...com>
---
 drivers/gpio/gpio-stmpe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index 094c5c4..dce3472 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -54,7 +54,7 @@ static int stmpe_gpio_get(struct gpio_chip *chip, unsigned offset)
 	if (ret < 0)
 		return ret;
 
-	return ret & mask;
+	return !!(ret & mask);
 }
 
 static void stmpe_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
-- 
1.7.8.110.g4cb5d

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ