svn commit: r296982 - head/sys/arm/allwinner

Michal Meloun mmel at FreeBSD.org
Thu Mar 17 08:57:43 UTC 2016


Author: mmel
Date: Thu Mar 17 08:57:41 2016
New Revision: 296982
URL: https://svnweb.freebsd.org/changeset/base/296982

Log:
  A20: Gpiobus can be attached only after full gpio driver initialization.
  While i'm in, remove now unused global variable.
  
  Submited by:	Emmanuel Vadot <manu at bidouilliste.com>

Modified:
  head/sys/arm/allwinner/a10_gpio.c

Modified: head/sys/arm/allwinner/a10_gpio.c
==============================================================================
--- head/sys/arm/allwinner/a10_gpio.c	Thu Mar 17 08:40:58 2016	(r296981)
+++ head/sys/arm/allwinner/a10_gpio.c	Thu Mar 17 08:57:41 2016	(r296982)
@@ -136,8 +136,6 @@ extern const struct allwinner_padconf a3
 #define	A10_GPIO_GP_INT_STA		0x214
 #define	A10_GPIO_GP_INT_DEB		0x218
 
-static struct a10_gpio_softc *a10_gpio_sc;
-
 #define	A10_GPIO_WRITE(_sc, _off, _val)		\
     bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val)
 #define	A10_GPIO_READ(_sc, _off)		\
@@ -562,12 +560,6 @@ a10_gpio_attach(device_t dev)
 		/* Node is not a GPIO controller. */
 		goto fail;
 
-	a10_gpio_sc = sc;
-	sc->sc_busdev = gpiobus_attach_bus(dev);
-	if (sc->sc_busdev == NULL)
-		goto fail;
-
-
 	/* Use the right pin data for the current SoC */
 	switch (allwinner_soc_type()) {
 #ifdef SOC_ALLWINNER_A10
@@ -594,6 +586,10 @@ a10_gpio_attach(device_t dev)
 		return (ENOENT);
 	}
 
+	sc->sc_busdev = gpiobus_attach_bus(dev);
+	if (sc->sc_busdev == NULL)
+		goto fail;
+
 	/*
 	 * Register as a pinctrl device
 	 */


More information about the svn-src-all mailing list