[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>
This commit is contained in:
Scott Wood 2007-03-12 14:41:53 -06:00 committed by Paul Mackerras
parent 5adeef52cc
commit fc58341161
2 changed files with 15 additions and 0 deletions

View File

@ -654,6 +654,19 @@ void *ft_find_device(struct ft_cxt *cxt, const char *srch_path)
return ft_get_phandle(cxt, node);
}
void *ft_find_device_rel(struct ft_cxt *cxt, const 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_get_phandle(cxt, node);
}
void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path)
{
struct ft_atom atom;

View File

@ -97,6 +97,8 @@ int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
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, const 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);