Fix an off-by-one bug in ar71xx_gpio and bcm2835_gpio which makes the last
pin unavailable. Reported and tested by: sbruno (ar71xx) Approved by: adrian (mentor) Pointy hat to: loos
This commit is contained in:
parent
5ee5ec755d
commit
8d900240b0
@ -729,7 +729,7 @@ bcm_gpio_attach(device_t dev)
|
||||
goto fail;
|
||||
|
||||
/* Initialize the software controlled pins. */
|
||||
for (i = 0, j = 0; j < BCM_GPIO_PINS - 1; j++) {
|
||||
for (i = 0, j = 0; j < BCM_GPIO_PINS; j++) {
|
||||
if (bcm_gpio_pin_is_ro(sc, j))
|
||||
continue;
|
||||
snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME,
|
||||
|
@ -418,7 +418,7 @@ ar71xx_gpio_attach(device_t dev)
|
||||
"pinon", &pinon) != 0)
|
||||
pinon = 0;
|
||||
device_printf(dev, "gpio pinmask=0x%x\n", mask);
|
||||
for (i = 0, j = 0; j < maxpin; j++) {
|
||||
for (i = 0, j = 0; j <= maxpin; j++) {
|
||||
if ((mask & (1 << j)) == 0)
|
||||
continue;
|
||||
snprintf(sc->gpio_pins[i].gp_name, GPIOMAXNAME,
|
||||
|
Loading…
Reference in New Issue
Block a user