aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-03-12 16:41:53 -0400
committerPaul Mackerras <paulus@samba.org>2007-03-16 00:49:08 -0400
commitfc583411617bf8a466c68350697a806704e88fc3 (patch)
tree816cd7bd2872f30dc8ffe0a9cd2bbfd9deaf9cc8 /arch/powerpc/boot
parent5adeef52ccc0229e06a6e0b2fefe442d8779f025 (diff)
[POWERPC] bootwrapper: Add ft_find_device_rel().
Add a function to look up a relative, rather than absolute, path name. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r--arch/powerpc/boot/flatdevtree.c13
-rw-r--r--arch/powerpc/boot/flatdevtree.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/boot/flatdevtree.c b/arch/powerpc/boot/flatdevtree.c
index e319a6502918..bd006f75e5ed 100644
--- a/arch/powerpc/boot/flatdevtree.c
+++ b/arch/powerpc/boot/flatdevtree.c
@@ -654,6 +654,19 @@ void *ft_find_device(struct ft_cxt *cxt, const char *srch_path)
654 return ft_get_phandle(cxt, node); 654 return ft_get_phandle(cxt, node);
655} 655}
656 656
657void *ft_find_device_rel(struct ft_cxt *cxt, const void *top,
658 const char *srch_path)
659{
660 char *node;
661
662 node = ft_node_ph2node(cxt, top);
663 if (node == NULL)
664 return NULL;
665
666 node = ft_find_descendent(cxt, node, srch_path);
667 return ft_get_phandle(cxt, node);
668}
669
657void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path) 670void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path)
658{ 671{
659 struct ft_atom atom; 672 struct ft_atom atom;
diff --git a/arch/powerpc/boot/flatdevtree.h b/arch/powerpc/boot/flatdevtree.h
index b9cd9f61f351..1f37ca2d34f6 100644
--- a/arch/powerpc/boot/flatdevtree.h
+++ b/arch/powerpc/boot/flatdevtree.h
@@ -97,6 +97,8 @@ int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
97void ft_dump_blob(const void *bphp); 97void ft_dump_blob(const void *bphp);
98void ft_merge_blob(struct ft_cxt *cxt, void *blob); 98void ft_merge_blob(struct ft_cxt *cxt, void *blob);
99void *ft_find_device(struct ft_cxt *cxt, const char *srch_path); 99void *ft_find_device(struct ft_cxt *cxt, const char *srch_path);
100void *ft_find_device_rel(struct ft_cxt *cxt, const void *top,
101 const char *srch_path);
100void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path); 102void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path);
101int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname, 103int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
102 void *buf, const unsigned int buflen); 104 void *buf, const unsigned int buflen);