From f021180bfbddac29778ed92477ea22aaed4abe9a Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Sat, 6 Sep 2014 17:50:59 +0000 Subject: [PATCH] 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. --- sys/dev/ofw/openfirm.c | 22 ++++------------------ sys/dev/ofw/openfirm.h | 4 +--- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/sys/dev/ofw/openfirm.c b/sys/dev/ofw/openfirm.c index 2546e05b044b..cc997d90f210 100644 --- a/sys/dev/ofw/openfirm.c +++ b/sys/dev/ofw/openfirm.c @@ -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 notfoundvalue) -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) { diff --git a/sys/dev/ofw/openfirm.h b/sys/dev/ofw/openfirm.h index ab958ba8fd99..d3967a4b9ecd 100644 --- a/sys/dev/ofw/openfirm.h +++ b/sys/dev/ofw/openfirm.h @@ -128,12 +128,10 @@ ssize_t OF_package_to_path(phandle_t node, char *buf, size_t len); * 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