From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 18:34:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8406748; Tue, 28 Oct 2014 18:34:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1884353; Tue, 28 Oct 2014 18:34:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9SIY4JD002619; Tue, 28 Oct 2014 18:34:04 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SIY09S002582; Tue, 28 Oct 2014 18:34:00 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201410281834.s9SIY09S002582@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 28 Oct 2014 18:34:00 +0000 (UTC) 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... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 18:34:05 -0000 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. */