diff options
author | raj <raj@FreeBSD.org> | 2010-11-11 13:42:46 +0000 |
---|---|---|
committer | raj <raj@FreeBSD.org> | 2010-11-11 13:42:46 +0000 |
commit | b34b9cfc1203162fdeb8d8177d2e2792291233d7 (patch) | |
tree | 61ff89fb2f079f88b448ba0999afaf269443204c /sys/dev/ofw | |
parent | 2222bc72a491219d131fd707ccac8546b34f9eb7 (diff) | |
download | FreeBSD-src-b34b9cfc1203162fdeb8d8177d2e2792291233d7.zip FreeBSD-src-b34b9cfc1203162fdeb8d8177d2e2792291233d7.tar.gz |
Return IEEE 1275 compliant error codes.
Submitted by: nwhitehorn
Diffstat (limited to 'sys/dev/ofw')
-rw-r--r-- | sys/dev/ofw/ofw_fdt.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/ofw/ofw_fdt.c b/sys/dev/ofw/ofw_fdt.c index d67b2e5..68d3149 100644 --- a/sys/dev/ofw/ofw_fdt.c +++ b/sys/dev/ofw/ofw_fdt.c @@ -221,7 +221,7 @@ ofw_fdt_instance_to_package(ofw_t ofw, ihandle_t instance) */ offset = fdt_node_offset_by_phandle(fdtp, instance); if (offset < 0) - return (0); + return (-1); p = (phandle_t)fdt_offset_ptr(fdtp, offset, sizeof(phandle_t)); return (p); @@ -236,7 +236,7 @@ ofw_fdt_getproplen(ofw_t ofw, phandle_t package, const char *propname) offset = fdt_phandle_offset(package); if (offset < 0) - return (0); + return (-1); if (strcmp(propname, "name") == 0) { /* Emulate the 'name' property */ @@ -244,7 +244,7 @@ ofw_fdt_getproplen(ofw_t ofw, phandle_t package, const char *propname) return (len + 1); } - len = 0; + len = -1; prop = fdt_get_property(fdtp, offset, propname, &len); return (len); @@ -261,7 +261,7 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t package, const char *propname, void *buf, offset = fdt_phandle_offset(package); if (offset < 0) - return (0); + return (-1); if (strcmp(propname, "name") == 0) { /* Emulate the 'name' property */ @@ -274,7 +274,7 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t package, const char *propname, void *buf, prop = fdt_getprop(fdtp, offset, propname, &len); if (prop == NULL) - return (0); + return (-1); if (len > buflen) len = buflen; @@ -314,7 +314,7 @@ fdt_nextprop(int offset, char *buf, size_t size) depth = -1; } while (depth >= 0); - return (0); + return (-1); } /* @@ -330,7 +330,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf, offset = fdt_phandle_offset(package); if (offset < 0) - return (0); + return (-1); if (previous == NULL) /* Find the first prop in the node */ @@ -341,7 +341,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf, */ prop = fdt_get_property(fdtp, offset, previous, NULL); if (prop == NULL) - return (0); + return (-1); offset = fdt_phandle_offset((phandle_t)prop); rv = fdt_nextprop(offset, buf, size); |