From: John Crispin <blogic@openwrt.org>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: John Crispin <blogic@openwrt.org>, linux-kernel@vger.kernel.org
Subject: [PATCH 6/6] GPIO: MIPS: lantiq: fix overflow inside stp-xway driver
Date: Tue, 24 Jul 2012 08:51:00 +0200 [thread overview]
Message-ID: <1343112660-12245-6-git-send-email-blogic@openwrt.org> (raw)
In-Reply-To: <1343112660-12245-1-git-send-email-blogic@openwrt.org>
The driver was using a 16 bit field for storing the shadow value of the shift
register cascade. This resulted in only the first 2 shift registeres receiving
the correct data. The third shift register would always receive 0x00.
Fix this by using a 32bit field for the shadow value.
Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-kernel@vger.kernel.org
---
drivers/gpio/gpio-stp-xway.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpio/gpio-stp-xway.c b/drivers/gpio/gpio-stp-xway.c
index e35096b..8bead0b 100644
--- a/drivers/gpio/gpio-stp-xway.c
+++ b/drivers/gpio/gpio-stp-xway.c
@@ -82,7 +82,7 @@ struct xway_stp {
struct gpio_chip gc;
void __iomem *virt;
u32 edge; /* rising or falling edge triggered shift register */
- u16 shadow; /* shadow the shift registers state */
+ u32 shadow; /* shadow the shift registers state */
u8 groups; /* we can drive 1-3 groups of 8bit each */
u8 dsl; /* the 2 LSBs can be driven by the dsl core */
u8 phy1; /* 3 bits can be driven by phy1 */
--
1.7.9.1
next prev parent reply other threads:[~2012-07-24 6:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-24 6:50 [PATCH 1/6] OF: pinctrl: MIPS: lantiq: implement lantiq/xway pinctrl support John Crispin
2012-07-24 6:50 ` [PATCH 2/6] Document: devicetree: add OF documents for lantiq xway pinctrl John Crispin
2012-07-24 6:50 ` [PATCH 3/6] OF: pinctrl: MIPS: lantiq: adds support for FALCON SoC John Crispin
2012-07-27 23:23 ` Linus Walleij
2012-07-30 9:41 ` John Crispin
2012-07-24 6:50 ` [PATCH 4/6] Document: devicetree: add OF documents for lantiq falcon pinctrl John Crispin
2012-07-24 6:50 ` [PATCH 5/6] GPIO: MIPS: add gpio driver for flacon SoC John Crispin
2012-07-24 8:09 ` Langer Thomas (LQDE RD ST PON SW)
2012-07-24 8:20 ` John Crispin
2012-07-24 6:51 ` John Crispin [this message]
2012-07-27 23:23 ` [PATCH 1/6] OF: pinctrl: MIPS: lantiq: implement lantiq/xway pinctrl support Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343112660-12245-6-git-send-email-blogic@openwrt.org \
--to=blogic@openwrt.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®