Fix off-by-one error that makes 0-th pins of each bank unreachable.

Submitted by:	Maxim Ignatenko <gelraen.ua@gmail.com>
This commit is contained in:
br 2014-05-30 07:43:55 +00:00
parent 57f87c2cb1
commit a26f767f98

View File

@ -223,7 +223,7 @@ get_bank(int gpio_number, struct gpio_bank *bank, int *pin_shift)
for (i = 0; i < NGRP; i++) { for (i = 0; i < NGRP; i++) {
ngpio = gpio_map[i].ngpio; ngpio = gpio_map[i].ngpio;
if ((n + ngpio) >= gpio_number) { if ((n + ngpio) > gpio_number) {
*bank = gpio_map[i]; *bank = gpio_map[i];
*pin_shift = (gpio_number - n); *pin_shift = (gpio_number - n);
return (0); return (0);