From 611d62353b8351a1e0ffb6dfe66f66ff3498bc4a Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 6 May 2015 02:36:01 +0000 Subject: [PATCH] Add missing braces so this will correctly fall back to the "name" property of a node if "device_type" is not present. ok mpi@ miod@ --- sys/arch/macppc/macppc/mainbus.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/arch/macppc/macppc/mainbus.c b/sys/arch/macppc/macppc/mainbus.c index 1494ae0f062..20635df9c00 100644 --- a/sys/arch/macppc/macppc/mainbus.c +++ b/sys/arch/macppc/macppc/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.23 2014/07/12 18:44:42 tedu Exp $ */ +/* $OpenBSD: mainbus.c,v 1.24 2015/05/06 02:36:01 jsg Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -157,13 +157,11 @@ mbattach(struct device *parent, struct device *self, void *aux) for (node = OF_child(OF_peer(0)); node; node=OF_peer(node)) { bzero (name, sizeof(name)); - if (OF_getprop(node, "device_type", name, - sizeof(name)) <= 0) { - if (OF_getprop(node, "name", name, - sizeof(name)) <= 0) - printf ("name not found on node %x\n", - node); + if (OF_getprop(node, "device_type", name, sizeof(name)) <= 0) { + if (OF_getprop(node, "name", name, sizeof(name)) <= 0) { + printf ("name not found on node %x\n", node); continue; + } } if (strcmp(name, "memory") == 0) { nca.ca_name = "mem"; -- 2.20.1