Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Dec 2014 19:31:57 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276151 - head/sys/arm/ti
Message-ID:  <201412231931.sBNJVv0j001773@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }



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