summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorDariusz Swiderski <dms@cvs.openbsd.org>2009-10-05 22:05:29 +0000
committerDariusz Swiderski <dms@cvs.openbsd.org>2009-10-05 22:05:29 +0000
commitec8a6a83d0719ac68b803c9591cd42107b2c1727 (patch)
treecd38ad8b2742075a869b6927c0567ebba2dc9852 /sys/arch
parentfeaac10ee46c23f3f1c68c2413d5721633c058af (diff)
remove nasty code, since now we have a nice function to lookup node'ss parent.
ok by kettenis@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/socppc/stand/boot/machdep.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/arch/socppc/stand/boot/machdep.c b/sys/arch/socppc/stand/boot/machdep.c
index e75baca1147..4fbe4a86789 100644
--- a/sys/arch/socppc/stand/boot/machdep.c
+++ b/sys/arch/socppc/stand/boot/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.2 2009/09/07 21:16:57 dms Exp $ */
+/* $OpenBSD: machdep.c,v 1.3 2009/10/05 22:05:28 dms Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
@@ -35,7 +35,6 @@ int wdc_obio_init (struct wdc_channel*, u_int);
void
machdep(void)
{
- char soc[32];
void *node;
char *tmp;
int len;
@@ -62,12 +61,10 @@ machdep(void)
if (len == 8)
consaddr = (uint8_t *)*(int *)tmp;
}
- memcpy(soc, console, 32);
- if (strchr(soc + 1, '/')!=0) {
- /* we are on a soc */
- *strchr(soc + 1, '/') = 0;
- node = fdt_find_node(soc);
- if (node) {
+ if (node = fdt_parent_node(node)) {
+ fdt_node_property(node, "device_type", &tmp);
+ if (strncmp(tmp, "soc", 3) == 0) {
+ /* we are on a soc */
len = fdt_node_property(node, "reg", &tmp);
if (len == 8)
consaddr += *(int *)tmp;