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

gpio: pci-idio-16: 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
f837bf6a 7a702691

+1 -1
+1 -1
drivers/gpio/gpio-pci-idio-16.c
··· 146 146 port_state = ioread8(ports[i]); 147 147 148 148 /* store acquired bits at respective bits array offset */ 149 - bits[word_index] |= port_state << word_offset; 149 + bits[word_index] |= (port_state << word_offset) & word_mask; 150 150 } 151 151 152 152 return 0;