From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 17:51:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5557B4F; Sat, 6 Sep 2014 17:51:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A73C210BC; Sat, 6 Sep 2014 17:51:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86Hp0l4030057; Sat, 6 Sep 2014 17:51:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86Hp0Vc030052; Sat, 6 Sep 2014 17:51:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409061751.s86Hp0Vc030052@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 6 Sep 2014 17:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271199 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 17:51:01 -0000 Author: ian Date: Sat Sep 6 17:50:59 2014 New Revision: 271199 URL: http://svnweb.freebsd.org/changeset/base/271199 Log: Revert rr271190, it was based on a misunderstanding. The problem of non-existant device<->xref info needs to be handled by creating the info, which will come in a subsequent commit. Modified: head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Sat Sep 6 17:33:41 2014 (r271198) +++ head/sys/dev/ofw/openfirm.c Sat Sep 6 17:50:59 2014 (r271199) @@ -554,15 +554,15 @@ OF_node_from_xref(phandle_t xref) return (node); } -static phandle_t -xref_from_node(phandle_t node, phandle_t notfoundvalue) +phandle_t +OF_xref_from_node(phandle_t node) { struct xrefinfo *xi; phandle_t xref; if (xref_init_done) { if ((xi = xrefinfo_find(node, FIND_BY_NODE)) == NULL) - return (notfoundvalue); + return (node); return (xi->xref); } @@ -570,24 +570,10 @@ xref_from_node(phandle_t node, phandle_t -1 && OF_getencprop(node, "ibm,phandle", &xref, sizeof(xref)) == -1 && OF_getencprop(node, "linux,phandle", &xref, sizeof(xref)) == -1) - return (notfoundvalue); + return (node); return (xref); } -phandle_t -OF_xref_from_node(phandle_t node) -{ - - return (xref_from_node(node, node)); -} - -phandle_t -OF_xref_from_node_strict(phandle_t node) -{ - - return (xref_from_node(node, -1)); -} - device_t OF_device_from_xref(phandle_t xref) { Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Sat Sep 6 17:33:41 2014 (r271198) +++ head/sys/dev/ofw/openfirm.h Sat Sep 6 17:50:59 2014 (r271199) @@ -128,12 +128,10 @@ ssize_t OF_package_to_path(phandle_t no * Some OF implementations (IBM, FDT) have a concept of effective phandles * used for device-tree cross-references. Given one of these, returns the * real phandle. If one can't be found (or running on OF implementations - * without this property), OF_xref_from_node() returns its input, while the - * strict version returns -1. + * without this property), returns its input. */ phandle_t OF_node_from_xref(phandle_t xref); phandle_t OF_xref_from_node(phandle_t node); -phandle_t OF_xref_from_node_strict(phandle_t node); /* * When properties contain references to other nodes using xref handles it is