Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jan 2016 02:58:29 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r293872 - head/sys/dev/gpio
Message-ID:  <201601140258.u0E2wTJB010724@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sgalabov@gmail.com>

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++;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601140258.u0E2wTJB010724>