summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2022-01-17 19:38:14 +0000
committerthorpej <thorpej@NetBSD.org>2022-01-17 19:38:14 +0000
commit9ea482c6b382f0d2dde8cd01639fd93326a99489 (patch)
tree6376393c771cd84fb68c04769ad2667c8251b67c /sys/dev
parent2ae042e9c902d63f61b508f9898d95cf5647b11e (diff)
Pass the controller devhandle along to the GPIO layer.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/mcp23xxxgpio.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/ic/mcp23xxxgpio.c b/sys/dev/ic/mcp23xxxgpio.c
index 0803f8f2c0d..b5ca8596ac4 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 <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