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

gpio: 104-dio-48e: 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
f90deea4 7ddb7dce

+1 -1
+1 -1
drivers/gpio/gpio-104-dio-48e.c
··· 222 222 port_state = inb(dio48egpio->base + ports[i]); 223 223 224 224 /* store acquired bits at respective bits array offset */ 225 - bits[word_index] |= port_state << word_offset; 225 + bits[word_index] |= (port_state << word_offset) & word_mask; 226 226 } 227 227 228 228 return 0;