Date: Thu, 17 Mar 2016 08:57:41 +0000 (UTC) From: Michal Meloun <mmel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296982 - head/sys/arm/allwinner Message-ID: <201603170857.u2H8vfQv035442@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603170857.u2H8vfQv035442>