Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Feb 2015 20:37:34 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r278782 - in stable/10/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/at...
Message-ID:  <201502142037.t1EKbYuS065674@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: loos
Date: Sat Feb 14 20:37:33 2015
New Revision: 278782
URL: https://svnweb.freebsd.org/changeset/base/278782

Log:
  MFC r273799:
  
  Make the GPIO children attach to the first unit available and not only to
  unit 0.
  
  This fix a bug where a GPIO controller could fail to attach its children
  (gpioc and gpiobus) if another GPIO driver attach first.

Modified:
  stable/10/sys/arm/allwinner/a10_gpio.c
  stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
  stable/10/sys/arm/freescale/imx/imx_gpio.c
  stable/10/sys/arm/freescale/vybrid/vf_gpio.c
  stable/10/sys/arm/lpc/lpc_gpio.c
  stable/10/sys/arm/rockchip/rk30xx_gpio.c
  stable/10/sys/arm/samsung/exynos/exynos5_pad.c
  stable/10/sys/arm/ti/ti_gpio.c
  stable/10/sys/arm/xilinx/zy7_gpio.c
  stable/10/sys/arm/xscale/ixp425/avila_gpio.c
  stable/10/sys/arm/xscale/ixp425/cambria_gpio.c
  stable/10/sys/mips/atheros/ar71xx_gpio.c
  stable/10/sys/mips/cavium/octeon_gpio.c
  stable/10/sys/mips/rt305x/rt305x_gpio.c
  stable/10/sys/powerpc/wii/wii_gpio.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/arm/allwinner/a10_gpio.c
==============================================================================
--- stable/10/sys/arm/allwinner/a10_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/arm/allwinner/a10_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -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: stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
==============================================================================
--- stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -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: stable/10/sys/arm/freescale/imx/imx_gpio.c
==============================================================================
--- stable/10/sys/arm/freescale/imx/imx_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/arm/freescale/imx/imx_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -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: stable/10/sys/arm/freescale/vybrid/vf_gpio.c
==============================================================================
--- stable/10/sys/arm/freescale/vybrid/vf_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/arm/freescale/vybrid/vf_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -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: stable/10/sys/arm/lpc/lpc_gpio.c
==============================================================================
--- stable/10/sys/arm/lpc/lpc_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/arm/lpc/lpc_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -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: stable/10/sys/arm/rockchip/rk30xx_gpio.c
==============================================================================
--- stable/10/sys/arm/rockchip/rk30xx_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/arm/rockchip/rk30xx_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -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: stable/10/sys/arm/samsung/exynos/exynos5_pad.c
==============================================================================
--- stable/10/sys/arm/samsung/exynos/exynos5_pad.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/arm/samsung/exynos/exynos5_pad.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -441,8 +441,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: stable/10/sys/arm/ti/ti_gpio.c
==============================================================================
--- stable/10/sys/arm/ti/ti_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/arm/ti/ti_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -822,8 +822,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: stable/10/sys/arm/xilinx/zy7_gpio.c
==============================================================================
--- stable/10/sys/arm/xilinx/zy7_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/arm/xilinx/zy7_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -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: stable/10/sys/arm/xscale/ixp425/avila_gpio.c
==============================================================================
--- stable/10/sys/arm/xscale/ixp425/avila_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/arm/xscale/ixp425/avila_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -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: stable/10/sys/arm/xscale/ixp425/cambria_gpio.c
==============================================================================
--- stable/10/sys/arm/xscale/ixp425/cambria_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/arm/xscale/ixp425/cambria_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -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: stable/10/sys/mips/atheros/ar71xx_gpio.c
==============================================================================
--- stable/10/sys/mips/atheros/ar71xx_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/mips/atheros/ar71xx_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -442,8 +442,9 @@ ar71xx_gpio_attach(device_t dev)
 		if ((pinon & (1 << j)) != 0)
 			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: stable/10/sys/mips/cavium/octeon_gpio.c
==============================================================================
--- stable/10/sys/mips/cavium/octeon_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/mips/cavium/octeon_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -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: stable/10/sys/mips/rt305x/rt305x_gpio.c
==============================================================================
--- stable/10/sys/mips/rt305x/rt305x_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/mips/rt305x/rt305x_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -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: stable/10/sys/powerpc/wii/wii_gpio.c
==============================================================================
--- stable/10/sys/powerpc/wii/wii_gpio.c	Sat Feb 14 20:32:24 2015	(r278781)
+++ stable/10/sys/powerpc/wii/wii_gpio.c	Sat Feb 14 20:37:33 2015	(r278782)
@@ -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?201502142037.t1EKbYuS065674>