From 6690c9f22f3caebb101ec0e4aec2b09ee28fa80f Mon Sep 17 00:00:00 2001 From: thorpej Date: Mon, 17 Jan 2022 19:38:14 +0000 Subject: [PATCH] Pass the controller devhandle along to the GPIO layer. --- sys/arch/arm/broadcom/bcm2835_gpio.c | 7 ++++--- sys/dev/ic/mcp23xxxgpio.c | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/arch/arm/broadcom/bcm2835_gpio.c b/sys/arch/arm/broadcom/bcm2835_gpio.c index e8af53ae9957..c9070562f545 100644 --- a/sys/arch/arm/broadcom/bcm2835_gpio.c +++ b/sys/arch/arm/broadcom/bcm2835_gpio.c @@ -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 -__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 self, void *aux) 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 */ diff --git a/sys/dev/ic/mcp23xxxgpio.c b/sys/dev/ic/mcp23xxxgpio.c index 0803f8f2c0dc..b5ca8596ac40 100644 --- a/sys/dev/ic/mcp23xxxgpio.c +++ b/sys/dev/ic/mcp23xxxgpio.c @@ -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 -__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