Module Name:    src
Committed By:   jmmv
Date:           Tue Jul 17 03:13:31 UTC 2012

Modified Files:
        src/sys/arch/powerpc/oea: ofwoea_machdep.c

Log Message:
OF_finddevice returns -1 on error, not an arbitrary negative number.  Make
conditional explicit so that model_name gets a chance to be initialized when
the handle for the device is actually negative (which appears to be the case
in my Mac Mini G4).


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/oea/ofwoea_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/powerpc/oea/ofwoea_machdep.c
diff -u src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.29 src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.30
--- src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.29	Tue May  8 05:15:45 2012
+++ src/sys/arch/powerpc/oea/ofwoea_machdep.c	Tue Jul 17 03:13:31 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ofwoea_machdep.c,v 1.29 2012/05/08 05:15:45 macallan Exp $ */
+/* $NetBSD: ofwoea_machdep.c,v 1.30 2012/07/17 03:13:31 jmmv Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.29 2012/05/08 05:15:45 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.30 2012/07/17 03:13:31 jmmv Exp $");
 
 #include "opt_ppcarch.h"
 #include "opt_compat_netbsd.h"
@@ -159,7 +159,7 @@ ofwoea_initppc(u_int startkernel, u_int 
 	/* get model name and perform model-specific actions */
 	memset(model_name, 0, sizeof(model_name));
 	node = OF_finddevice("/");
-	if (node >= 0) {
+	if (node != -1) {
 		l = OF_getprop(node, "model", model_name, sizeof(model_name));
 		if (l == -1)
 			OF_getprop(node, "name", model_name,

Reply via email to