Skip to content

Commit

Permalink
gpio: pcie-idio-24: Fix off-by-one error in get_multiple loop
Browse files Browse the repository at this point in the history
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: ca37081 ("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>
  • Loading branch information
William Breathitt Gray authored and Linus Walleij committed Apr 30, 2018
1 parent 304440a commit e026646
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/gpio-pcie-idio-24.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static int idio_24_gpio_get_multiple(struct gpio_chip *chip,
bitmap_zero(bits, chip->ngpio);

/* get bits are evaluated a gpio port register at a time */
for (i = 0; i < ARRAY_SIZE(ports); i++) {
for (i = 0; i < ARRAY_SIZE(ports) + 1; i++) {
/* gpio offset in bits array */
bits_offset = i * gpio_reg_size;

Expand Down

0 comments on commit e026646

Please sign in to comment.