Author: adrian
Date: Thu Jan 14 02:58:28 2016
New Revision: 293872
URL: https://svnweb.freebsd.org/changeset/base/293872

Log:
  [gpiobus] handle the case of there being a single GPIO pin available.
  
  PR:           kern/206035
  Submitted by: Stanislav Galabov <[email protected]>

Modified:
  head/sys/dev/gpio/gpiobus.c

Modified: head/sys/dev/gpio/gpiobus.c
==============================================================================
--- head/sys/dev/gpio/gpiobus.c Thu Jan 14 02:55:28 2016        (r293871)
+++ head/sys/dev/gpio/gpiobus.c Thu Jan 14 02:58:28 2016        (r293872)
@@ -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++;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to