linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 10/19] bootwrapper: Add ft_find_device_rel().
@ 2007-03-12 20:41 Scott Wood
  2007-03-13 22:00 ` Mark A. Greer
  2007-03-16  2:00 ` David Gibson
  0 siblings, 2 replies; 4+ messages in thread
From: Scott Wood @ 2007-03-12 20:41 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

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

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

diff --git a/arch/powerpc/boot/flatdevtree.c b/arch/powerpc/boot/flatdevtree.c
index 605d248..b0d27c9 100644
--- a/arch/powerpc/boot/flatdevtree.c
+++ b/arch/powerpc/boot/flatdevtree.c
@@ -658,6 +658,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;
diff --git a/arch/powerpc/boot/flatdevtree.h b/arch/powerpc/boot/flatdevtree.h
index b9cd9f6..1f37ca2 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);
 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);
-- 
1.5.0.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 10/19] bootwrapper: Add ft_find_device_rel().
  2007-03-12 20:41 [PATCH 10/19] bootwrapper: Add ft_find_device_rel() Scott Wood
@ 2007-03-13 22:00 ` Mark A. Greer
  2007-03-16  2:00 ` David Gibson
  1 sibling, 0 replies; 4+ messages in thread
From: Mark A. Greer @ 2007-03-13 22:00 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, paulus

On Mon, Mar 12, 2007 at 02:41:53PM -0600, Scott Wood wrote:
> 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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 10/19] bootwrapper: Add ft_find_device_rel().
  2007-03-12 20:41 [PATCH 10/19] bootwrapper: Add ft_find_device_rel() Scott Wood
  2007-03-13 22:00 ` Mark A. Greer
@ 2007-03-16  2:00 ` David Gibson
  2007-03-16  2:05   ` David Gibson
  1 sibling, 1 reply; 4+ messages in thread
From: David Gibson @ 2007-03-16  2:00 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, paulus

On Mon, Mar 12, 2007 at 02:41:53PM -0600, Scott Wood wrote:
> Add a function to look up a relative, rather than absolute, path
> name.

Ok, I was dubious for a while, but I'm now convinced of the need for
this one.

Except, to keep the dt_ops structure simple, I'd prefer to see
relative lookup by the *only* one implemented in the hook methods.
Absolute finddevice can then be implemented as a trivial wrapper
around that.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 10/19] bootwrapper: Add ft_find_device_rel().
  2007-03-16  2:00 ` David Gibson
@ 2007-03-16  2:05   ` David Gibson
  0 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2007-03-16  2:05 UTC (permalink / raw)
  To: Scott Wood, paulus, linuxppc-dev

On Fri, Mar 16, 2007 at 01:00:36PM +1100, David Gibson wrote:
> On Mon, Mar 12, 2007 at 02:41:53PM -0600, Scott Wood wrote:
> > Add a function to look up a relative, rather than absolute, path
> > name.
> 
> Ok, I was dubious for a while, but I'm now convinced of the need for
> this one.
> 
> Except, to keep the dt_ops structure simple, I'd prefer to see
> relative lookup by the *only* one implemented in the hook methods.
> Absolute finddevice can then be implemented as a trivial wrapper
> around that.

And the hooks are added in a later patch in any case, so:
Acked-by: David Gibson <david@gibson.dropbear.id.au>

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-03-16  2:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-12 20:41 [PATCH 10/19] bootwrapper: Add ft_find_device_rel() Scott Wood
2007-03-13 22:00 ` Mark A. Greer
2007-03-16  2:00 ` David Gibson
2007-03-16  2:05   ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).