Skip to content

Commit

Permalink
GPIO: MIPS: lantiq: fix overflow inside stp-xway driver
Browse files Browse the repository at this point in the history
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
  • Loading branch information
John Crispin committed Sep 13, 2012
1 parent 6a88a0f commit c9e854c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/gpio-stp-xway.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit c9e854c

Please sign in to comment.