diff options
author | William Breathitt Gray <vilhelm.gray@gmail.com> | 2018-04-20 09:50:20 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-04-30 04:48:08 -0400 |
commit | e026646c178d8292de563fbecc247bada059c282 (patch) | |
tree | cced27a85129ff2a04f885ab8ac51248751db1d0 | |
parent | 304440aa96c6e5cc37eaa7a46ff4dd862e4c21be (diff) |
gpio: pcie-idio-24: Fix off-by-one error in get_multiple loop
The PCIe-IDIO-24 features 8 bits of TTL GPIO which may be configured for
output or input. This patch fixes an off-by-one error in the loop
conditional for the get_multiple callback so that the TTL GPIO are
handled.
Fixes: ca37081595a2 ("gpio: pcie-idio-24: Implement get_multiple/set_multiple callbacks")
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-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 3e77c2a9a9fd..f953541e7890 100644 --- a/drivers/gpio/gpio-pcie-idio-24.c +++ b/drivers/gpio/gpio-pcie-idio-24.c | |||
@@ -217,7 +217,7 @@ static int idio_24_gpio_get_multiple(struct gpio_chip *chip, | |||
217 | bitmap_zero(bits, chip->ngpio); | 217 | bitmap_zero(bits, chip->ngpio); |
218 | 218 | ||
219 | /* get bits are evaluated a gpio port register at a time */ | 219 | /* get bits are evaluated a gpio port register at a time */ |
220 | for (i = 0; i < ARRAY_SIZE(ports); i++) { | 220 | for (i = 0; i < ARRAY_SIZE(ports) + 1; i++) { |
221 | /* gpio offset in bits array */ | 221 | /* gpio offset in bits array */ |
222 | bits_offset = i * gpio_reg_size; | 222 | bits_offset = i * gpio_reg_size; |
223 | 223 | ||