Author: raj Date: Thu Nov 11 13:42:46 2010 New Revision: 215120 URL: http://svn.freebsd.org/changeset/base/215120
Log: Return IEEE 1275 compliant error codes. Submitted by: nwhitehorn Modified: head/sys/dev/ofw/ofw_fdt.c Modified: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- head/sys/dev/ofw/ofw_fdt.c Thu Nov 11 13:35:23 2010 (r215119) +++ head/sys/dev/ofw/ofw_fdt.c Thu Nov 11 13:42:46 2010 (r215120) @@ -221,7 +221,7 @@ ofw_fdt_instance_to_package(ofw_t ofw, i */ 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 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 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 pac 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 pac 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 depth = -1; } while (depth >= 0); - return (0); + return (-1); } /* @@ -330,7 +330,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t pa 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 pa */ 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); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"