Module Name:    src
Committed By:   thorpej
Date:           Mon Jan 17 19:38:14 UTC 2022

Modified Files:
        src/sys/arch/arm/broadcom: bcm2835_gpio.c
        src/sys/dev/ic: mcp23xxxgpio.c

Log Message:
Pass the controller devhandle along to the GPIO layer.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/broadcom/bcm2835_gpio.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/mcp23xxxgpio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_gpio.c
diff -u src/sys/arch/arm/broadcom/bcm2835_gpio.c:1.23 src/sys/arch/arm/broadcom/bcm2835_gpio.c:1.24
--- src/sys/arch/arm/broadcom/bcm2835_gpio.c:1.23	Sat Aug 21 23:00:31 2021
+++ src/sys/arch/arm/broadcom/bcm2835_gpio.c	Mon Jan 17 19:38:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_gpio.c,v 1.23 2021/08/21 23:00:31 andvar Exp $	*/
+/*	$NetBSD: bcm2835_gpio.c,v 1.24 2022/01/17 19:38:14 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2013, 2014, 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio.c,v 1.23 2021/08/21 23:00:31 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio.c,v 1.24 2022/01/17 19:38:14 thorpej Exp $");
 
 /*
  * Driver for BCM2835 GPIO
@@ -383,7 +383,8 @@ bcmgpio_attach(device_t parent, device_t
 	gba.gba_gc = &sc->sc_gpio_gc;
 	gba.gba_pins = &sc->sc_gpio_pins[0];
 	gba.gba_npins = sc->sc_maxpins;
-	config_found(self, &gba, gpiobus_print, CFARGS_NONE);
+	config_found(self, &gba, gpiobus_print,
+	    CFARGS(.devhandle = device_handle(self)));
 }
 
 /* GPIO interrupt support functions */

Index: src/sys/dev/ic/mcp23xxxgpio.c
diff -u src/sys/dev/ic/mcp23xxxgpio.c:1.1 src/sys/dev/ic/mcp23xxxgpio.c:1.2
--- src/sys/dev/ic/mcp23xxxgpio.c:1.1	Mon Jan 17 16:31:23 2022
+++ src/sys/dev/ic/mcp23xxxgpio.c	Mon Jan 17 19:38:14 2022
@@ -1,4 +1,4 @@
-/*      $NetBSD: mcp23xxxgpio.c,v 1.1 2022/01/17 16:31:23 thorpej Exp $	*/
+/*      $NetBSD: mcp23xxxgpio.c,v 1.2 2022/01/17 19:38:14 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2014, 2022 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mcp23xxxgpio.c,v 1.1 2022/01/17 16:31:23 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mcp23xxxgpio.c,v 1.2 2022/01/17 19:38:14 thorpej Exp $");
 
 /* 
  * Driver for Microchip serial I/O expansers:
@@ -293,7 +293,7 @@ mcpgpio_attach(struct mcpgpio_softc *sc)
 	 */
 	if (sc->sc_npins == 0) {
 		sc->sc_npins = sc->sc_variant->type == MCPGPIO_TYPE_23x08
-		? MCP23x08_GPIO_NPINS : MCP23x17_GPIO_NPINS;
+		    ? MCP23x08_GPIO_NPINS : MCP23x17_GPIO_NPINS;
 	}
 	sc->sc_gpio_pins =
 	    kmem_zalloc(sc->sc_npins * sizeof(*sc->sc_gpio_pins), KM_SLEEP);
@@ -348,7 +348,8 @@ mcpgpio_attach(struct mcpgpio_softc *sc)
 	gba.gba_pins = sc->sc_gpio_pins;
 	gba.gba_npins = sc->sc_npins;
 
-	config_found(sc->sc_dev, &gba, gpiobus_print, CFARGS_NONE);
+	config_found(sc->sc_dev, &gba, gpiobus_print,
+	    CFARGS(.devhandle = device_handle(sc->sc_dev)));
 #else
 	aprint_normal_dev(sc->sc_dev, "no GPIO configured in kernel");
 #endif

Reply via email to