diff options
author | William Breathitt Gray <vilhelm.gray@gmail.com> | 2018-10-22 21:10:20 +0900 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-11-05 08:54:42 +0100 |
commit | 25451945648af488077ed61afc59a79710422f31 (patch) | |
tree | f15b891a999e09d14318bc127440d8071ecce1c8 /drivers/gpio | |
parent | f837bf6acaf54aa8b3a09378f5c8ec1ca2cd3338 (diff) | |
download | linux-25451945648af488077ed61afc59a79710422f31.tar.bz2 |
gpio: pcie-idio-24: 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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-pcie-idio-24.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-pcie-idio-24.c b/drivers/gpio/gpio-pcie-idio-24.c index f953541e7890..52f1647a46fd 100644 --- a/drivers/gpio/gpio-pcie-idio-24.c +++ b/drivers/gpio/gpio-pcie-idio-24.c @@ -243,7 +243,7 @@ static int idio_24_gpio_get_multiple(struct gpio_chip *chip, port_state = ioread8(&idio24gpio->reg->ttl_in0_7); /* store acquired bits at respective bits array offset */ - bits[word_index] |= port_state << word_offset; + bits[word_index] |= (port_state << word_offset) & word_mask; } return 0; |