Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: gpio-mm: Mask read inputs for get_multiple

This patch masks the read inputs with the word mask in order to ensure
only requested input states are returned in the bits array.

Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

William Breathitt Gray and committed by
Linus Walleij
3bfbc440 b7f53f67

+1 -1
+1 -1
drivers/gpio/gpio-gpio-mm.c
··· 211 211 port_state = inb(gpiommgpio->base + ports[i]); 212 212 213 213 /* store acquired bits at respective bits array offset */ 214 - bits[word_index] |= port_state << word_offset; 214 + bits[word_index] |= (port_state << word_offset) & word_mask; 215 215 } 216 216 217 217 return 0;