[PATCH 14/18] Make flatdevtree_misc's cxt global.

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE7130d

3 messages, 3 authors, 2007-01-24 · open the first message on its own page

[PATCH 14/18] Make flatdevtree_misc's cxt global.

From: Scott Wood <hidden>
Date: 2007-01-24 21:07:29

This allows platform code to use flatdevtree functions directly.

Signed-off-by: Scott Wood <redacted>
---
 arch/powerpc/boot/flatdevtree_misc.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/boot/flatdevtree_misc.c b/arch/powerpc/boot/flatdevtree_misc.c
index 04da38f..da49ffb 100644
--- a/arch/powerpc/boot/flatdevtree_misc.c
+++ b/arch/powerpc/boot/flatdevtree_misc.c
@@ -14,29 +14,29 @@
 #include "flatdevtree.h"
 #include "ops.h"
 
-static struct ft_cxt cxt;
+struct ft_cxt fdtm_cxt;
 
 static void *ft_finddevice(const char *name)
 {
-	return ft_find_device(&cxt, name);
+	return ft_find_device(&fdtm_cxt, name);
 }
 
 static int ft_getprop(const void *phandle, const char *propname, void *buf,
 		const int buflen)
 {
-	return ft_get_prop(&cxt, phandle, propname, buf, buflen);
+	return ft_get_prop(&fdtm_cxt, phandle, propname, buf, buflen);
 }
 
 static int ft_setprop(const void *phandle, const char *propname,
 		const void *buf, const int buflen)
 {
-	return ft_set_prop(&cxt, phandle, propname, buf, buflen);
+	return ft_set_prop(&fdtm_cxt, phandle, propname, buf, buflen);
 }
 
 static unsigned long ft_finalize(void)
 {
-	ft_end_tree(&cxt);
-	return (unsigned long)cxt.bph;
+	ft_end_tree(&fdtm_cxt);
+	return (unsigned long)fdtm_cxt.bph;
 }
 
 int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device)
@@ -46,6 +46,6 @@ int ft_init(void *dt_blob, unsigned int
 	dt_ops.setprop = ft_setprop;
 	dt_ops.finalize = ft_finalize;
 
-	return ft_open(&cxt, dt_blob, max_size, max_find_device,
+	return ft_open(&fdtm_cxt, dt_blob, max_size, max_find_device,
 			platform_ops.realloc);
 }
-- 
1.4.4

Re: [PATCH 14/18] Make flatdevtree_misc's cxt global.

From: Segher Boessenkool <hidden>
Date: 2007-01-24 21:53:49

This allows platform code to use flatdevtree functions directly.
-static struct ft_cxt cxt;
+struct ft_cxt fdtm_cxt;
If I understand the code correctly, you should put this
in a header file (that this file includes itself) too?


Segher

Re: [PATCH 14/18] Make flatdevtree_misc's cxt global.

From: Mark A. Greer <hidden>
Date: 2007-01-24 23:15:45

On Wed, Jan 24, 2007 at 03:07:26PM -0600, Scott Wood wrote:
This allows platform code to use flatdevtree functions directly.

Signed-off-by: Scott Wood <redacted>
---
Scott,

I have to to thru your patches in detail but I have a comment about this
patch...

I don't think this one is a good idea.  Platform code shouldn't be using
flatdevtree.c code directly because it will be replaced by libfdt code.
For functionality that isn't already accessible, you should define an
interface then access it thru the interface glue code (i.e.,
flatdevtree_misc.c).  This will separate the calls that bootwrapper code
uses from whatever the underlying implementation is.

Mark
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help