Add missing braces so this will correctly fall back to the "name"
authorjsg <jsg@openbsd.org>
Wed, 6 May 2015 02:36:01 +0000 (02:36 +0000)
committerjsg <jsg@openbsd.org>
Wed, 6 May 2015 02:36:01 +0000 (02:36 +0000)
property of a node if "device_type" is not present.

ok mpi@ miod@

sys/arch/macppc/macppc/mainbus.c

index 1494ae0..20635df 100644 (file)
@@ -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";