diff options
| author | thorpej <thorpej@NetBSD.org> | 2022-01-22 11:49:16 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2022-01-22 11:49:16 +0000 |
| commit | 09eb5c43f131a6790fa9b46f440dd5a2d4ae03ae (patch) | |
| tree | ffdfd13d89a9bfa56433c400ad83033887f60a5f /sys/dev/fdt | |
| parent | 1c2752a686271470f2f20bdba60a27d2b6d5b8a8 (diff) | |
Change the devhandle_from_*() functions to also take a "super handle",
from which the newly created handle will inherit it's implementation.
The root implementation for a new handle type is used if an invalid
"super handle" is passed.
Diffstat (limited to 'sys/dev/fdt')
| -rw-r--r-- | sys/dev/fdt/fdtbus.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/fdt/fdtbus.c b/sys/dev/fdt/fdtbus.c index c9e2a2e83d6..86879f63c14 100644 --- a/sys/dev/fdt/fdtbus.c +++ b/sys/dev/fdt/fdtbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: fdtbus.c,v 1.44 2021/11/07 17:12:15 jmcneill Exp $ */ +/* $NetBSD: fdtbus.c,v 1.45 2022/01/22 11:49:17 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.44 2021/11/07 17:12:15 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.45 2022/01/22 11:49:17 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -423,12 +423,15 @@ fdt_scan(struct fdt_softc *sc, int pass) */ fdt_pre_attach(node); + devhandle_t nodeh = device_handle(node->n_bus); + if (quiet) { node->n_dev = config_attach(node->n_bus, node->n_cf, &faa, fdtbus_print, CFARGS(.locators = locs, .devhandle = - devhandle_from_of(node->n_phandle))); + devhandle_from_of(nodeh, + node->n_phandle))); } else { /* * Default pass. @@ -439,7 +442,8 @@ fdt_scan(struct fdt_softc *sc, int pass) .iattr = "fdt", .locators = locs, .devhandle = - devhandle_from_of(node->n_phandle))); + devhandle_from_of(nodeh, + node->n_phandle))); } if (node->n_dev != NULL) |
