Date: Tue, 28 Oct 2014 18:34:00 +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: r273799 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/lpc arm/rockchip arm/samsung/exynos arm/ti arm/xilinx arm/xscale/ixp425 mips/atheros... Message-ID: <201410281834.s9SIY09S002582@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: loos Date: Tue Oct 28 18:33:59 2014 New Revision: 273799 URL: https://svnweb.freebsd.org/changeset/base/273799 Log: Make the GPIO children attach to the first unit available and not only to unit 0. It seems that this 'simplification' was copied to all GPIO drivers in tree. This fix a bug where a GPIO controller could fail to attach its children (gpioc and gpiobus) if another GPIO driver attach first. Modified: head/sys/arm/allwinner/a10_gpio.c head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/freescale/imx/imx_gpio.c head/sys/arm/freescale/vybrid/vf_gpio.c head/sys/arm/lpc/lpc_gpio.c head/sys/arm/rockchip/rk30xx_gpio.c head/sys/arm/samsung/exynos/exynos5_pad.c head/sys/arm/ti/ti_gpio.c head/sys/arm/xilinx/zy7_gpio.c head/sys/arm/xscale/ixp425/avila_gpio.c head/sys/arm/xscale/ixp425/cambria_gpio.c head/sys/mips/atheros/ar71xx_gpio.c head/sys/mips/cavium/octeon_gpio.c head/sys/mips/rt305x/rt305x_gpio.c head/sys/powerpc/wii/wii_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/allwinner/a10_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -474,8 +474,8 @@ a10_gpio_attach(device_t dev) } sc->sc_gpio_npins = i; - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); a10_gpio_sc = sc; Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -747,8 +747,9 @@ bcm_gpio_attach(device_t dev) bcm_gpio_sysctl_init(sc); - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); + return (bus_generic_attach(dev)); fail: Modified: head/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/freescale/imx/imx_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -435,8 +435,8 @@ imx51_gpio_attach(device_t dev) "imx_gpio%d.%d", device_get_unit(dev), i); } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/arm/freescale/vybrid/vf_gpio.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/freescale/vybrid/vf_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -146,8 +146,8 @@ vf_gpio_attach(device_t dev) "vf_gpio%d.%d", device_get_unit(dev), i); } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/arm/lpc/lpc_gpio.c ============================================================================== --- head/sys/arm/lpc/lpc_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/lpc/lpc_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -192,8 +192,8 @@ lpc_gpio_attach(device_t dev) lpc_gpio_sc = sc; - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/rockchip/rk30xx_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -504,8 +504,8 @@ rk30_gpio_attach(device_t dev) } sc->sc_gpio_npins = i; - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); rk30_gpio_sc = sc; Modified: head/sys/arm/samsung/exynos/exynos5_pad.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_pad.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/samsung/exynos/exynos5_pad.c Tue Oct 28 18:33:59 2014 (r273799) @@ -559,8 +559,8 @@ pad_attach(device_t dev) "pad%d.%d", device_get_unit(dev), i); } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/ti/ti_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -800,8 +800,8 @@ ti_gpio_attach(device_t dev) } /* Finish of the probe call */ - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/arm/xilinx/zy7_gpio.c ============================================================================== --- head/sys/arm/xilinx/zy7_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/xilinx/zy7_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -329,8 +329,8 @@ zy7_gpio_attach(device_t dev) /* Completely reset. */ zy7_gpio_hw_reset(sc); - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/arm/xscale/ixp425/avila_gpio.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/xscale/ixp425/avila_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -318,8 +318,9 @@ avila_gpio_attach(device_t dev) sc->sc_valid |= 1 << p->pin; } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); + return (bus_generic_attach(dev)); #undef N } Modified: head/sys/arm/xscale/ixp425/cambria_gpio.c ============================================================================== --- head/sys/arm/xscale/ixp425/cambria_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/xscale/ixp425/cambria_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -447,8 +447,9 @@ cambria_gpio_attach(device_t dev) cambria_gpio_pin_setflags(dev, pin, p->flags); } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); + return (bus_generic_attach(dev)); } Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/mips/atheros/ar71xx_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -441,8 +441,9 @@ ar71xx_gpio_attach(device_t dev) ar71xx_gpio_pin_set(dev, j, 1); } } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); + return (bus_generic_attach(dev)); } Modified: head/sys/mips/cavium/octeon_gpio.c ============================================================================== --- head/sys/mips/cavium/octeon_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/mips/cavium/octeon_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -441,8 +441,9 @@ octeon_gpio_attach(device_t dev) } } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); + return (bus_generic_attach(dev)); } Modified: head/sys/mips/rt305x/rt305x_gpio.c ============================================================================== --- head/sys/mips/rt305x/rt305x_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/mips/rt305x/rt305x_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -511,9 +511,8 @@ rt305x_gpio_attach(device_t dev) } #endif - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); - + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/powerpc/wii/wii_gpio.c ============================================================================== --- head/sys/powerpc/wii/wii_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/powerpc/wii/wii_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -182,8 +182,8 @@ wiigpio_attach(device_t dev) "GPIO_PIN_INPUT" : "GPIO_PIN_OUTPUT"); #endif } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); /* * We will be responsible for powering off the system. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410281834.s9SIY09S002582>