summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2022-01-22 11:49:16 +0000
committerthorpej <thorpej@NetBSD.org>2022-01-22 11:49:16 +0000
commit09eb5c43f131a6790fa9b46f440dd5a2d4ae03ae (patch)
treeffdfd13d89a9bfa56433c400ad83033887f60a5f /sys/dev
parent1c2752a686271470f2f20bdba60a27d2b6d5b8a8 (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')
-rw-r--r--sys/dev/acpi/acpi.c10
-rw-r--r--sys/dev/acpi/acpi_pci.c6
-rw-r--r--sys/dev/acpi/acpi_util.c23
-rw-r--r--sys/dev/acpi/acpi_util.h4
-rw-r--r--sys/dev/fdt/fdtbus.c12
-rw-r--r--sys/dev/i2c/i2c.c10
-rw-r--r--sys/dev/ofisa/ofisa.c7
-rw-r--r--sys/dev/ofw/ofbus.c12
-rw-r--r--sys/dev/ofw/ofw_pci_subr.c6
-rw-r--r--sys/dev/ofw/ofw_subr.c22
-rw-r--r--sys/dev/ofw/openfirm.h4
-rw-r--r--sys/dev/sbus/dma_sbus.c7
-rw-r--r--sys/dev/sbus/lebuffer.c7
-rw-r--r--sys/dev/sbus/qec.c7
14 files changed, 83 insertions, 54 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index d018fdda109..3d955d536d4 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.295 2021/12/31 14:22:42 riastradh Exp $ */
+/* $NetBSD: acpi.c,v 1.296 2022/01/22 11:49:17 thorpej Exp $ */
/*-
* Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.295 2021/12/31 14:22:42 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.296 2022/01/22 11:49:17 thorpej Exp $");
#include "pci.h"
#include "opt_acpi.h"
@@ -962,7 +962,8 @@ acpi_rescan_early(struct acpi_softc *sc)
ad->ad_device = config_found(sc->sc_dev, &aa, acpi_print,
CFARGS(.iattr = "acpinodebus",
- .devhandle = devhandle_from_acpi(ad->ad_handle)));
+ .devhandle = devhandle_from_acpi(devhandle_invalid(),
+ ad->ad_handle)));
}
}
@@ -1029,7 +1030,8 @@ acpi_rescan_nodes(struct acpi_softc *sc)
ad->ad_device = config_found(sc->sc_dev, &aa, acpi_print,
CFARGS(.iattr = "acpinodebus",
- .devhandle = devhandle_from_acpi(ad->ad_handle)));
+ .devhandle = devhandle_from_acpi(devhandle_invalid(),
+ ad->ad_handle)));
}
}
diff --git a/sys/dev/acpi/acpi_pci.c b/sys/dev/acpi/acpi_pci.c
index e8be8114d58..83a2e152afd 100644
--- a/sys/dev/acpi/acpi_pci.c
+++ b/sys/dev/acpi/acpi_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci.c,v 1.33 2021/12/20 11:17:40 skrll Exp $ */
+/* $NetBSD: acpi_pci.c,v 1.34 2022/01/22 11:49:17 thorpej Exp $ */
/*
* Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_pci.c,v 1.33 2021/12/20 11:17:40 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_pci.c,v 1.34 2022/01/22 11:49:17 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -572,7 +572,7 @@ acpi_pci_bus_get_child_devhandle(device_t dev, devhandle_t call_handle, void *v)
if (ad != NULL && (hdl = ad->ad_handle) != NULL) {
/* Found it! */
- args->devhandle = devhandle_from_acpi(hdl);
+ args->devhandle = devhandle_from_acpi(call_handle, hdl);
return 0;
}
diff --git a/sys/dev/acpi/acpi_util.c b/sys/dev/acpi/acpi_util.c
index a1087fbcfce..674d9f9132c 100644
--- a/sys/dev/acpi/acpi_util.c
+++ b/sys/dev/acpi/acpi_util.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_util.c,v 1.31 2022/01/15 14:40:22 jmcneill Exp $ */
+/* $NetBSD: acpi_util.c,v 1.32 2022/01/22 11:49:17 thorpej Exp $ */
/*-
* Copyright (c) 2003, 2007, 2021 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_util.c,v 1.31 2022/01/15 14:40:22 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_util.c,v 1.32 2022/01/22 11:49:17 thorpej Exp $");
#include <sys/param.h>
#include <sys/kmem.h>
@@ -121,12 +121,18 @@ static const struct devhandle_impl acpi_devhandle_impl = {
};
devhandle_t
-devhandle_from_acpi(ACPI_HANDLE const hdl)
+devhandle_from_acpi(devhandle_t super_handle, ACPI_HANDLE const hdl)
{
- devhandle_t handle = {
- .impl = &acpi_devhandle_impl,
- .pointer = hdl,
- };
+ devhandle_type_t super_type = devhandle_type(super_handle);
+ devhandle_t handle = { 0 };
+
+ if (super_type == DEVHANDLE_TYPE_ACPI) {
+ handle.impl = super_handle.impl;
+ } else {
+ KASSERT(super_type == DEVHANDLE_TYPE_INVALID);
+ handle.impl = &acpi_devhandle_impl;
+ }
+ handle.pointer = hdl;
return handle;
}
@@ -154,7 +160,8 @@ acpi_device_enumerate_children(device_t dev, devhandle_t call_handle, void *v)
!acpi_device_present(ad->ad_handle)) {
continue;
}
- if (!args->callback(dev, devhandle_from_acpi(ad->ad_handle),
+ if (!args->callback(dev, devhandle_from_acpi(call_handle,
+ ad->ad_handle),
args->callback_arg)) {
break;
}
diff --git a/sys/dev/acpi/acpi_util.h b/sys/dev/acpi/acpi_util.h
index 74b8db97bbf..0659d21299c 100644
--- a/sys/dev/acpi/acpi_util.h
+++ b/sys/dev/acpi/acpi_util.h
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_util.h,v 1.13 2022/01/15 14:40:33 jmcneill Exp $ */
+/* $NetBSD: acpi_util.h,v 1.14 2022/01/22 11:49:17 thorpej Exp $ */
/*-
* Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
#ifndef _SYS_DEV_ACPI_ACPI_UTIL_H
#define _SYS_DEV_ACPI_ACPI_UTIL_H
-devhandle_t devhandle_from_acpi(ACPI_HANDLE);
+devhandle_t devhandle_from_acpi(devhandle_t, ACPI_HANDLE);
ACPI_HANDLE devhandle_to_acpi(devhandle_t);
#define ACPI_DEVICE_CALL_REGISTER(_n_, _c_) \
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)
diff --git a/sys/dev/i2c/i2c.c b/sys/dev/i2c/i2c.c
index c6ef68e2019..f31abc9b4a9 100644
--- a/sys/dev/i2c/i2c.c
+++ b/sys/dev/i2c/i2c.c
@@ -1,4 +1,4 @@
-/* $NetBSD: i2c.c,v 1.82 2022/01/21 15:55:36 thorpej Exp $ */
+/* $NetBSD: i2c.c,v 1.83 2022/01/22 11:49:17 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -53,7 +53,7 @@
#endif /* _KERNEL_OPT */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.82 2022/01/21 15:55:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.83 2022/01/22 11:49:17 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -498,13 +498,15 @@ iic_attach(device_t parent, device_t self, void *aux)
devhandle = devhandle_invalid();
#ifdef I2C_USE_FDT
if (cookietype == I2C_COOKIE_OF) {
- devhandle = devhandle_from_of((int)cookie);
+ devhandle = devhandle_from_of(devhandle,
+ (int)cookie);
}
#endif /* I2C_USE_FDT */
#ifdef I2C_USE_ACPI
if (cookietype == I2C_COOKIE_ACPI) {
devhandle =
- devhandle_from_acpi((ACPI_HANDLE)cookie);
+ devhandle_from_acpi(devhandle,
+ (ACPI_HANDLE)cookie);
}
#endif /* I2C_USE_ACPI */
diff --git a/sys/dev/ofisa/ofisa.c b/sys/dev/ofisa/ofisa.c
index f2bbf204613..cc9045522cd 100644
--- a/sys/dev/ofisa/ofisa.c
+++ b/sys/dev/ofisa/ofisa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ofisa.c,v 1.34 2021/08/07 16:19:13 thorpej Exp $ */
+/* $NetBSD: ofisa.c,v 1.35 2022/01/22 11:49:17 thorpej Exp $ */
/*
* Copyright 1997, 1998
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofisa.c,v 1.34 2021/08/07 16:19:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofisa.c,v 1.35 2022/01/22 11:49:17 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -127,6 +127,7 @@ ofisaattach(device_t parent, device_t self, void *aux)
isa_dmainit(iba.iba_ic, iba.iba_iot, iba.iba_dmat, self);
#endif
+ devhandle_t selfh = device_handle(self);
for (child = OF_child(oba->oba_phandle); child;
child = OF_peer(child)) {
if (ofisa_ignore_child(oba->oba_phandle, child))
@@ -142,7 +143,7 @@ ofisaattach(device_t parent, device_t self, void *aux)
aa.ic = iba.iba_ic;
config_found(self, &aa, ofisaprint,
- CFARGS(.devhandle = devhandle_from_of(child)));
+ CFARGS(.devhandle = devhandle_from_of(selfh, child)));
}
}
diff --git a/sys/dev/ofw/ofbus.c b/sys/dev/ofw/ofbus.c
index dfb07dcf003..2abf8f9341c 100644
--- a/sys/dev/ofw/ofbus.c
+++ b/sys/dev/ofw/ofbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ofbus.c,v 1.30 2021/08/07 16:19:14 thorpej Exp $ */
+/* $NetBSD: ofbus.c,v 1.31 2022/01/22 11:49:18 thorpej Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofbus.c,v 1.30 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofbus.c,v 1.31 2022/01/22 11:49:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -159,6 +159,8 @@ ofbus_attach(device_t parent, device_t dev, void *aux)
units = 2;
}
+ devhandle_t selfh = device_handle(dev);
+
/* attach displays first */
for (child = OF_child(oba->oba_phandle); child != 0;
child = OF_peer(child)) {
@@ -181,7 +183,8 @@ ofbus_attach(device_t parent, device_t dev, void *aux)
sizeof(oba2.oba_ofname));
}
config_found(dev, &oba2, ofbus_print,
- CFARGS(.devhandle = devhandle_from_of(child)));
+ CFARGS(.devhandle = devhandle_from_of(selfh,
+ child)));
}
}
@@ -211,7 +214,8 @@ ofbus_attach(device_t parent, device_t dev, void *aux)
sizeof(oba2.oba_ofname));
}
config_found(dev, &oba2, ofbus_print,
- CFARGS(.devhandle = devhandle_from_of(child)));
+ CFARGS(.devhandle = devhandle_from_of(selfh,
+ child)));
}
}
}
diff --git a/sys/dev/ofw/ofw_pci_subr.c b/sys/dev/ofw/ofw_pci_subr.c
index 0671befc1e6..f658e79bff8 100644
--- a/sys/dev/ofw/ofw_pci_subr.c
+++ b/sys/dev/ofw/ofw_pci_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_pci_subr.c,v 1.2 2021/09/15 17:33:08 thorpej Exp $ */
+/* $NetBSD: ofw_pci_subr.c,v 1.3 2022/01/22 11:49:18 thorpej Exp $ */
/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_pci_subr.c,v 1.2 2021/09/15 17:33:08 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_pci_subr.c,v 1.3 2022/01/22 11:49:18 thorpej Exp $");
#include <sys/types.h>
#include <sys/device.h>
@@ -77,7 +77,7 @@ ofw_pci_bus_get_child_devhandle(device_t dev, devhandle_t call_handle, void *v)
}
/* Found it! */
- args->devhandle = devhandle_from_of(phandle);
+ args->devhandle = devhandle_from_of(call_handle, phandle);
return 0;
}
diff --git a/sys/dev/ofw/ofw_subr.c b/sys/dev/ofw/ofw_subr.c
index 01cbed6fd44..e0532a5ad8d 100644
--- a/sys/dev/ofw/ofw_subr.c
+++ b/sys/dev/ofw/ofw_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_subr.c,v 1.59 2021/09/15 17:33:08 thorpej Exp $ */
+/* $NetBSD: ofw_subr.c,v 1.60 2022/01/22 11:49:18 thorpej Exp $ */
/*
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.59 2021/09/15 17:33:08 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.60 2022/01/22 11:49:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -99,12 +99,18 @@ static const struct devhandle_impl of_devhandle_impl = {
};
devhandle_t
-devhandle_from_of(int phandle)
+devhandle_from_of(devhandle_t super_handle, int phandle)
{
- devhandle_t handle = {
- .impl = &of_devhandle_impl,
- .integer = phandle,
- };
+ devhandle_type_t super_type = devhandle_type(super_handle);
+ devhandle_t handle = { 0 };
+
+ if (super_type == DEVHANDLE_TYPE_OF) {
+ handle.impl = super_handle.impl;
+ } else {
+ KASSERT(super_type == DEVHANDLE_TYPE_INVALID);
+ handle.impl = &of_devhandle_impl;
+ }
+ handle.integer = phandle;
return handle;
}
@@ -125,7 +131,7 @@ of_device_enumerate_children(device_t dev, devhandle_t call_handle, void *v)
int child;
for (child = OF_child(phandle); child != 0; child = OF_peer(child)) {
- if (!args->callback(dev, devhandle_from_of(child),
+ if (!args->callback(dev, devhandle_from_of(call_handle, child),
args->callback_arg)) {
break;
}
diff --git a/sys/dev/ofw/openfirm.h b/sys/dev/ofw/openfirm.h
index 34eee8e53bc..55733c08483 100644
--- a/sys/dev/ofw/openfirm.h
+++ b/sys/dev/ofw/openfirm.h
@@ -1,4 +1,4 @@
-/* $NetBSD: openfirm.h,v 1.47 2021/04/24 23:36:57 thorpej Exp $ */
+/* $NetBSD: openfirm.h,v 1.48 2022/01/22 11:49:18 thorpej Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -107,7 +107,7 @@ int openfirmware(void *);
#ifdef _KERNEL
struct device_compatible_entry;
-devhandle_t devhandle_from_of(int);
+devhandle_t devhandle_from_of(devhandle_t, int);
int devhandle_to_of(devhandle_t);
#define OF_DEVICE_CALL_REGISTER(_n_, _c_) \
diff --git a/sys/dev/sbus/dma_sbus.c b/sys/dev/sbus/dma_sbus.c
index 56fdca53073..6efd00de826 100644
--- a/sys/dev/sbus/dma_sbus.c
+++ b/sys/dev/sbus/dma_sbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dma_sbus.c,v 1.38 2021/08/07 16:19:15 thorpej Exp $ */
+/* $NetBSD: dma_sbus.c,v 1.39 2022/01/22 11:49:18 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dma_sbus.c,v 1.38 2021/08/07 16:19:15 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dma_sbus.c,v 1.39 2022/01/22 11:49:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -207,11 +207,12 @@ dmaattach_sbus(device_t parent, device_t self, void *aux)
lsi64854_attach(sc);
/* Attach children */
+ devhandle_t selfh = device_handle(self);
for (node = firstchild(sa->sa_node); node; node = nextsibling(node)) {
struct sbus_attach_args sax;
sbus_setup_attach_args(sbsc, sbt, sc->sc_dmatag, node, &sax);
(void)config_found(self, (void *)&sax, dmaprint_sbus,
- CFARGS(.devhandle = prom_node_to_devhandle(node)));
+ CFARGS(.devhandle = prom_node_to_devhandle(selfh, node)));
sbus_destroy_attach_args(&sax);
}
}
diff --git a/sys/dev/sbus/lebuffer.c b/sys/dev/sbus/lebuffer.c
index 7bfc7c22297..0630927e3f1 100644
--- a/sys/dev/sbus/lebuffer.c
+++ b/sys/dev/sbus/lebuffer.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lebuffer.c,v 1.39 2021/08/07 16:19:15 thorpej Exp $ */
+/* $NetBSD: lebuffer.c,v 1.40 2022/01/22 11:49:18 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lebuffer.c,v 1.39 2021/08/07 16:19:15 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lebuffer.c,v 1.40 2022/01/22 11:49:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -120,12 +120,13 @@ lebufattach(device_t parent, device_t self, void *aux)
printf(": %dK memory\n", sc->sc_bufsiz / 1024);
/* search through children */
+ devhandle_t selfh = device_handle(self);
for (node = firstchild(node); node; node = nextsibling(node)) {
struct sbus_attach_args sax;
sbus_setup_attach_args(sbsc,
bt, dt, node, &sax);
(void)config_found(self, (void *)&sax, lebufprint,
- CFARGS(.devhandle = prom_node_to_devhandle(node)));
+ CFARGS(.devhandle = prom_node_to_devhandle(selfh, node)));
sbus_destroy_attach_args(&sax);
}
}
diff --git a/sys/dev/sbus/qec.c b/sys/dev/sbus/qec.c
index 2842343bb56..bcff50b1600 100644
--- a/sys/dev/sbus/qec.c
+++ b/sys/dev/sbus/qec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: qec.c,v 1.53 2021/08/07 16:19:15 thorpej Exp $ */
+/* $NetBSD: qec.c,v 1.54 2022/01/22 11:49:18 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: qec.c,v 1.53 2021/08/07 16:19:15 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: qec.c,v 1.54 2022/01/22 11:49:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -203,12 +203,13 @@ qecattach(device_t parent, device_t self, void *aux)
qec_init(sc);
/* search through children */
+ devhandle_t selfh = device_handle(self);
for (node = firstchild(node); node; node = nextsibling(node)) {
struct sbus_attach_args sax;
sbus_setup_attach_args(sbsc,
sbt, sc->sc_dmatag, node, &sax);
(void)config_found(self, (void *)&sax, qecprint,
- CFARGS(.devhandle = prom_node_to_devhandle(node)));
+ CFARGS(.devhandle = prom_node_to_devhandle(selfh, node)));
sbus_destroy_attach_args(&sax);
}
}