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 note to self: OF_getprop() returns -1 on...
details: https://anonhg.NetBSD.org/src/rev/bb281ae6178f
branches: trunk
changeset: 358985:bb281ae6178f
user: macallan <macallan%NetBSD.org@localhost>
date: Wed Jan 24 17:21:03 2018 +0000
description:
note to self: OF_getprop() returns -1 on error
now this works properly on sevan's iMac G4
diffstat:
sys/arch/macppc/dev/ki2c.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (29 lines):
diff -r ddc535983348 -r bb281ae6178f sys/arch/macppc/dev/ki2c.c
--- a/sys/arch/macppc/dev/ki2c.c Wed Jan 24 14:45:44 2018 +0000
+++ b/sys/arch/macppc/dev/ki2c.c Wed Jan 24 17:21:03 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ki2c.c,v 1.23 2017/09/27 22:10:19 macallan Exp $ */
+/* $NetBSD: ki2c.c,v 1.24 2018/01/24 17:21:03 macallan Exp $ */
/* Id: ki2c.c,v 1.7 2002/10/05 09:56:05 tsubai Exp */
/*-
@@ -151,15 +151,15 @@
devs = OF_child(i2cbus);
while (devs != 0) {
- if (OF_getprop(devs, "name", name, 32) == 0)
+ if (OF_getprop(devs, "name", name, 32) <= 0)
goto skip;
- if (OF_getprop(devs, "compatible", compat, 256) == 0) {
+ if (OF_getprop(devs, "compatible", compat, 256) <= 0) {
/* some i2c device nodes don't have 'compatible' */
memset(compat, 0, 256);
strncpy(compat, name, 256);
}
- if (OF_getprop(devs, "reg", &addr, 4) == 0)
- if (OF_getprop(devs, "i2c-address", &addr, 4) == 0)
+ if (OF_getprop(devs, "reg", &addr, 4) <= 0)
+ if (OF_getprop(devs, "i2c-address", &addr, 4) <= 0)
goto skip;
addr = (addr & 0xff) >> 1;
DPRINTF("-> %s@%x\n", name, addr);
Home |
Main Index |
Thread Index |
Old Index