Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/macppc/dev OF_getprop() retuns -1 on failure, not 0...



details:   https://anonhg.NetBSD.org/src/rev/b404b7e82ad2
branches:  trunk
changeset: 359594:b404b7e82ad2
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Feb 16 18:07:05 2018 +0000

description:
OF_getprop() retuns -1 on failure, not 0...

diffstat:

 sys/arch/macppc/dev/pmu.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r 94d28297744e -r b404b7e82ad2 sys/arch/macppc/dev/pmu.c
--- a/sys/arch/macppc/dev/pmu.c Fri Feb 16 18:04:06 2018 +0000
+++ b/sys/arch/macppc/dev/pmu.c Fri Feb 16 18:07:05 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmu.c,v 1.29 2017/09/29 14:15:42 macallan Exp $ */
+/*     $NetBSD: pmu.c,v 1.30 2018/02/16 18:07:05 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.29 2017/09/29 14:15:42 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.30 2018/02/16 18:07:05 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -338,7 +338,7 @@
 
        while (node != 0) {
 
-               if (OF_getprop(node, "name", name, 256) == 0)
+               if (OF_getprop(node, "name", name, 256) <= 0)
                        goto next;
 
                if (strncmp(name, "pmu-i2c", 8) == 0) {
@@ -358,12 +358,12 @@
                        /* look for i2c devices */
                        devs = OF_child(node);
                        while (devs != 0) {
-                               if (OF_getprop(devs, "name", name, 256) == 0)
+                               if (OF_getprop(devs, "name", name, 256) <= 0)
                                        goto skip;
                                if (OF_getprop(devs, "compatible",
-                                   compat, 256) == 0)
+                                   compat, 256) <= 0)
                                        goto skip;
-                               if (OF_getprop(devs, "reg", &addr, 4) == 0)
+                               if (OF_getprop(devs, "reg", &addr, 4) <= 0)
                                        goto skip;
                                addr = (addr & 0xff) >> 1;
                                DPRINTF("-> %s@%x\n", name, addr);



Home | Main Index | Thread Index | Old Index