[PATCH 10/18] Add ft_find_device_rel().

Scott Wood scottwood at freescale.com
Thu Jan 25 08:07:20 EST 2007


Add a function to look up a relative, rather than absolute, path name.

Signed-off-by: Scott Wood <scottwood at freescale.com>
---
 arch/powerpc/boot/flatdevtree.c |   12 ++++++++++++
 arch/powerpc/boot/flatdevtree.h |    1 +
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/flatdevtree.c b/arch/powerpc/boot/flatdevtree.c
index e46346b..87a4a06 100644
--- a/arch/powerpc/boot/flatdevtree.c
+++ b/arch/powerpc/boot/flatdevtree.c
@@ -654,6 +654,18 @@ void *ft_find_device(struct ft_cxt *cxt,
 	return ft_node_add(cxt, node);
 }
 
+void *ft_find_device_rel(struct ft_cxt *cxt, void *top, const char *srch_path)
+{
+	char *node;
+
+	node = ft_node_ph2node(cxt, top);
+	if (node == NULL)
+		return NULL;
+
+	node = ft_find_descendent(cxt, node, srch_path);
+	return ft_node_add(cxt, node);
+}
+
 void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path)
 {
 	struct ft_atom atom;
diff --git a/arch/powerpc/boot/flatdevtree.h b/arch/powerpc/boot/flatdevtree.h
index b9cd9f6..462fbb9 100644
--- a/arch/powerpc/boot/flatdevtree.h
+++ b/arch/powerpc/boot/flatdevtree.h
@@ -97,6 +97,7 @@ int ft_add_rsvmap(struct ft_cxt *cxt, u6
 void ft_dump_blob(const void *bphp);
 void ft_merge_blob(struct ft_cxt *cxt, void *blob);
 void *ft_find_device(struct ft_cxt *cxt, const char *srch_path);
+void *ft_find_device_rel(struct ft_cxt *cxt, void *top, const char *srch_path);
 void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path);
 int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
 		void *buf, const unsigned int buflen);
-- 
1.4.4




More information about the Linuxppc-dev mailing list