[gpiobus] handle the case of there being a single GPIO pin available.

PR:		kern/206035
Submitted by:	Stanislav Galabov <sgalabov@gmail.com>
This commit is contained in:
Adrian Chadd 2016-01-14 02:58:28 +00:00
parent 358d08b83b
commit 82104eda6a

View File

@ -184,7 +184,7 @@ gpiobus_init_softc(device_t dev)
if (GPIO_PIN_MAX(sc->sc_dev, &sc->sc_npins) != 0)
return (ENXIO);
KASSERT(sc->sc_npins != 0, ("GPIO device with no pins"));
KASSERT(sc->sc_npins >= 0, ("GPIO device with no pins"));
/* Pins = GPIO_PIN_MAX() + 1 */
sc->sc_npins++;