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:
parent
57f87c2cb1
commit
a26f767f98
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user