Index: sys/mips/atheros/ar71xx_gpio.c =================================================================== --- sys/mips/atheros/ar71xx_gpio.c (revision 255228) +++ sys/mips/atheros/ar71xx_gpio.c (working copy) @@ -169,7 +169,7 @@ struct ar71xx_gpio_softc *sc = device_get_softc(dev); int i; - for (i = 0; i < sc->gpio_npins; i++) { + for (i = 0; i <= sc->gpio_npins; i++) { if (sc->gpio_pins[i].gp_pin == pin) break; } @@ -190,7 +190,7 @@ struct ar71xx_gpio_softc *sc = device_get_softc(dev); int i; - for (i = 0; i < sc->gpio_npins; i++) { + for (i = 0; i <= sc->gpio_npins; i++) { if (sc->gpio_pins[i].gp_pin == pin) break; } @@ -211,7 +211,7 @@ struct ar71xx_gpio_softc *sc = device_get_softc(dev); int i; - for (i = 0; i < sc->gpio_npins; i++) { + for (i = 0; i <= sc->gpio_npins; i++) { if (sc->gpio_pins[i].gp_pin == pin) break; } @@ -232,7 +232,7 @@ int i; struct ar71xx_gpio_softc *sc = device_get_softc(dev); - for (i = 0; i < sc->gpio_npins; i++) { + for (i = 0; i <= sc->gpio_npins; i++) { if (sc->gpio_pins[i].gp_pin == pin) break; } @@ -259,7 +259,7 @@ struct ar71xx_gpio_softc *sc = device_get_softc(dev); int i; - for (i = 0; i < sc->gpio_npins; i++) { + for (i = 0; i <= sc->gpio_npins; i++) { if (sc->gpio_pins[i].gp_pin == pin) break; } @@ -281,7 +281,7 @@ struct ar71xx_gpio_softc *sc = device_get_softc(dev); int i; - for (i = 0; i < sc->gpio_npins; i++) { + for (i = 0; i <= sc->gpio_npins; i++) { if (sc->gpio_pins[i].gp_pin == pin) break; } @@ -300,7 +300,7 @@ int res, i; struct ar71xx_gpio_softc *sc = device_get_softc(dev); - for (i = 0; i < sc->gpio_npins; i++) { + for (i = 0; i <= sc->gpio_npins; i++) { if (sc->gpio_pins[i].gp_pin == pin) break; } @@ -418,7 +418,7 @@ "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, @@ -430,7 +430,7 @@ i++; } sc->gpio_npins = i; - for (i = 0; i < sc->gpio_npins; i++) { + for (i = 0; i <= sc->gpio_npins; i++) { j = sc->gpio_pins[i].gp_pin; if ((pinon & (1 << j)) != 0) ar71xx_gpio_pin_set(dev, j, 1);