svn commit: r276151 - head/sys/arm/ti

Luiz Otavio O Souza loos at FreeBSD.org
Tue Dec 23 19:31:57 UTC 2014


Author: loos
Date: Tue Dec 23 19:31:56 2014
New Revision: 276151
URL: https://svnweb.freebsd.org/changeset/base/276151

Log:
  Do not return the total number of available pins but the maximum pin number
  we can cope.
  
  Previously the returned value could prevent access to some of the pins.

Modified:
  head/sys/arm/ti/ti_gpio.c

Modified: head/sys/arm/ti/ti_gpio.c
==============================================================================
--- head/sys/arm/ti/ti_gpio.c	Tue Dec 23 18:48:45 2014	(r276150)
+++ head/sys/arm/ti/ti_gpio.c	Tue Dec 23 19:31:56 2014	(r276151)
@@ -293,19 +293,8 @@ ti_gpio_intr_clr(struct ti_gpio_softc *s
 static int
 ti_gpio_pin_max(device_t dev, int *maxpin)
 {
-	struct ti_gpio_softc *sc = device_get_softc(dev);
-	unsigned int i;
-	unsigned int banks = 0;
-
-	/* Calculate how many valid banks we have and then multiply that by 32 to
-	 * give use the total number of pins.
-	 */
-	for (i = 0; i < ti_max_gpio_banks(); i++) {
-		if (sc->sc_mem_res[i] != NULL)
-			banks++;
-	}
 
-	*maxpin = (banks * PINS_PER_BANK) - 1;
+	*maxpin = ti_max_gpio_banks() * PINS_PER_BANK - 1;
 
 	return (0);
 }


More information about the svn-src-head mailing list