Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/oea OF_finddevice returns -1 on error, not ...
details: https://anonhg.NetBSD.org/src/rev/395ef61db7ea
branches: trunk
changeset: 780230:395ef61db7ea
user: jmmv <jmmv%NetBSD.org@localhost>
date: Tue Jul 17 03:13:31 2012 +0000
description:
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).
diffstat:
sys/arch/powerpc/oea/ofwoea_machdep.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r e99cb54064fa -r 395ef61db7ea sys/arch/powerpc/oea/ofwoea_machdep.c
--- a/sys/arch/powerpc/oea/ofwoea_machdep.c Tue Jul 17 01:36:12 2012 +0000
+++ b/sys/arch/powerpc/oea/ofwoea_machdep.c Tue Jul 17 03:13:31 2012 +0000
@@ -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 @@
/* 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,
Home |
Main Index |
Thread Index |
Old Index