summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/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/arch/macppc/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/arch/macppc/dev')
-rw-r--r--sys/arch/macppc/dev/gpio.c7
-rw-r--r--sys/arch/macppc/dev/mediabay.c7
-rw-r--r--sys/arch/macppc/dev/obio.c7
-rw-r--r--sys/arch/macppc/dev/smu.c3
-rw-r--r--sys/arch/macppc/dev/uni-n.c7
5 files changed, 18 insertions, 13 deletions
diff --git a/sys/arch/macppc/dev/gpio.c b/sys/arch/macppc/dev/gpio.c
index 677cc0c3999..fd2abb47f7e 100644
--- a/sys/arch/macppc/dev/gpio.c
+++ b/sys/arch/macppc/dev/gpio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gpio.c,v 1.15 2021/08/07 16:18:57 thorpej Exp $ */
+/* $NetBSD: gpio.c,v 1.16 2022/01/22 11:49:16 thorpej Exp $ */
/*-
* Copyright (C) 1998 Internet Research Institute, Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.15 2021/08/07 16:18:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.16 2022/01/22 11:49:16 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -97,6 +97,7 @@ gpio_obio_attach(device_t parent, device_t self, void *aux)
sc->sc_port = mapiodev(ca->ca_baseaddr + ca->ca_reg[0], ca->ca_reg[1],
false);
+ devhandle_t selfh = device_handle(self);
ca2.ca_baseaddr = ca->ca_baseaddr;
for (child = OF_child(ca->ca_node); child; child = OF_peer(child)) {
namelen = OF_getprop(child, "name", name, sizeof(name));
@@ -120,7 +121,7 @@ gpio_obio_attach(device_t parent, device_t self, void *aux)
ca2.ca_intr = intr;
config_found(self, &ca2, gpio_obio_print,
- CFARGS(.devhandle = devhandle_from_of(child)));
+ CFARGS(.devhandle = devhandle_from_of(selfh, child)));
}
}
diff --git a/sys/arch/macppc/dev/mediabay.c b/sys/arch/macppc/dev/mediabay.c
index 88da69bdaff..bb97e3be04b 100644
--- a/sys/arch/macppc/dev/mediabay.c
+++ b/sys/arch/macppc/dev/mediabay.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mediabay.c,v 1.26 2021/08/07 16:18:57 thorpej Exp $ */
+/* $NetBSD: mediabay.c,v 1.27 2022/01/22 11:49:16 thorpej Exp $ */
/*-
* Copyright (C) 1999 Tsubai Masanari. All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mediabay.c,v 1.26 2021/08/07 16:18:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mediabay.c,v 1.27 2022/01/22 11:49:16 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -225,6 +225,7 @@ mediabay_attach_content(struct mediabay_softc *sc)
printf(" done.\n");
}
+ devhandle_t selfh = device_handle(sc->sc_dev);
for (child = OF_child(sc->sc_node); child; child = OF_peer(child)) {
memset(name, 0, sizeof(name));
if (OF_getprop(child, "name", name, sizeof(name)) == -1)
@@ -244,7 +245,7 @@ mediabay_attach_content(struct mediabay_softc *sc)
ca.ca_intr = intr;
content = config_found(sc->sc_dev, &ca, mediabay_print,
- CFARGS(.devhandle = devhandle_from_of(child)));
+ CFARGS(.devhandle = devhandle_from_of(selfh, child)));
if (content) {
sc->sc_content = content;
return;
diff --git a/sys/arch/macppc/dev/obio.c b/sys/arch/macppc/dev/obio.c
index b1eb97856da..e186e50aa30 100644
--- a/sys/arch/macppc/dev/obio.c
+++ b/sys/arch/macppc/dev/obio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: obio.c,v 1.50 2021/08/07 16:18:57 thorpej Exp $ */
+/* $NetBSD: obio.c,v 1.51 2022/01/22 11:49:16 thorpej Exp $ */
/*-
* Copyright (C) 1998 Internet Research Institute, Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.50 2021/08/07 16:18:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.51 2022/01/22 11:49:16 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -236,6 +236,7 @@ obio_attach(device_t parent, device_t self, void *aux)
bus_space_write_1(ca.ca_tag, bsh, 0x37, 0x03);
}
+ devhandle_t selfh = device_handle(self);
for (child = OF_child(node); child; child = OF_peer(child)) {
namelen = OF_getprop(child, "name", name, sizeof(name));
if (namelen < 0)
@@ -272,7 +273,7 @@ obio_attach(device_t parent, device_t self, void *aux)
ca.ca_intr = intr;
config_found(self, &ca, obio_print,
- CFARGS(.devhandle = devhandle_from_of(child)));
+ CFARGS(.devhandle = devhandle_from_of(selfh, child)));
}
}
diff --git a/sys/arch/macppc/dev/smu.c b/sys/arch/macppc/dev/smu.c
index cb0fb182bda..c190e06648b 100644
--- a/sys/arch/macppc/dev/smu.c
+++ b/sys/arch/macppc/dev/smu.c
@@ -365,6 +365,7 @@ smu_setup_iicbus(struct smu_softc *sc)
int node;
char name[32];
+ devhandle_t selfh = device_handle(sc->sc_dev);
node = of_getnode_byname(sc->sc_node, "smu-i2c-control");
if (node == 0) node = sc->sc_node;
for (node = OF_child(node);
@@ -393,7 +394,7 @@ smu_setup_iicbus(struct smu_softc *sc)
ca.ca_node = node;
ca.ca_tag = i2c;
config_found(sc->sc_dev, &ca, smu_iicbus_print,
- CFARGS(.devhandle = devhandle_from_of(node)));
+ CFARGS(.devhandle = devhandle_from_of(selfh, node)));
sc->sc_num_iicbus++;
}
diff --git a/sys/arch/macppc/dev/uni-n.c b/sys/arch/macppc/dev/uni-n.c
index 0c749fada3c..0ea58134598 100644
--- a/sys/arch/macppc/dev/uni-n.c
+++ b/sys/arch/macppc/dev/uni-n.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uni-n.c,v 1.11 2021/08/07 16:18:58 thorpej Exp $ */
+/* $NetBSD: uni-n.c,v 1.12 2022/01/22 11:49:16 thorpej Exp $ */
/*-
* Copyright (C) 2005 Michael Lorenz.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uni-n.c,v 1.11 2021/08/07 16:18:58 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uni-n.c,v 1.12 2022/01/22 11:49:16 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -129,6 +129,7 @@ uni_n_attach(device_t parent, device_t self, void *aux)
panic("Can't init uni-n mem tag");
}
+ devhandle_t selfh = device_handle(self);
for (child = OF_child(node); child; child = OF_peer(child)) {
namelen = OF_getprop(child, "name", name, sizeof(name));
if (namelen < 0)
@@ -150,7 +151,7 @@ uni_n_attach(device_t parent, device_t self, void *aux)
ca.ca_reg = reg;
ca.ca_intr = intr;
config_found(self, &ca, uni_n_print,
- CFARGS(.devhandle = devhandle_from_of(child)));
+ CFARGS(.devhandle = devhandle_from_of(selfh, child)));
}
}