From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 13:42:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 591501065670; Thu, 11 Nov 2010 13:42:47 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D69C8FC0A; Thu, 11 Nov 2010 13:42:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABDglsp069050; Thu, 11 Nov 2010 13:42:47 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABDglN3069048; Thu, 11 Nov 2010 13:42:47 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201011111342.oABDglN3069048@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 11 Nov 2010 13:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215120 - head/sys/dev/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 13:42:47 -0000 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);