From 82104eda6a5b4e245b6d3cf240e6bb6efdd186bb Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Thu, 14 Jan 2016 02:58:28 +0000 Subject: [PATCH] [gpiobus] handle the case of there being a single GPIO pin available. PR: kern/206035 Submitted by: Stanislav Galabov --- sys/dev/gpio/gpiobus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index 67106eaaca82..4a7994ead3a1 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -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++;