mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] OF: base: call of_parse_phandles() from of_unflatten_dtb()
@ 2013-07-12 16:32 Jan Luebbe
  0 siblings, 0 replies; only message in thread
From: Jan Luebbe @ 2013-07-12 16:32 UTC (permalink / raw)
  To: barebox

This allows using node->phandle before a call to of_probe().

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
 drivers/of/base.c |    6 ++----
 drivers/of/fdt.c  |    1 +
 include/of.h      |    1 +
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 7bee912..075eed9 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1562,7 +1562,7 @@ int of_add_memory(struct device_node *node, bool dump)
 	return 0;
 }
 
-static void __of_parse_phandles(struct device_node *node)
+void of_parse_phandles(struct device_node *node)
 {
 	struct device_node *n;
 	phandle phandle;
@@ -1575,7 +1575,7 @@ static void __of_parse_phandles(struct device_node *node)
 	}
 
 	list_for_each_entry(n, &node->children, parent_list)
-		__of_parse_phandles(n);
+		of_parse_phandles(n);
 }
 
 struct device_node *of_chosen;
@@ -1604,8 +1604,6 @@ int of_probe(void)
 	of_chosen = of_find_node_by_path("/chosen");
 	of_property_read_string(root_node, "model", &of_model);
 
-	__of_parse_phandles(root_node);
-
 	memory = of_find_node_by_path("/memory");
 	if (memory)
 		of_add_memory(memory, false);
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 76d6bb1..1cccd3d 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -202,6 +202,7 @@ struct device_node *of_unflatten_dtb(struct device_node *root, void *infdt)
 			break;
 
 		case FDT_END:
+			of_parse_phandles(root);
 			return root;
 
 		default:
diff --git a/include/of.h b/include/of.h
index ebe8e39..9055625 100644
--- a/include/of.h
+++ b/include/of.h
@@ -199,6 +199,7 @@ extern int of_property_write_u64_array(struct device_node *np,
 				const char *propname, const u64 *values,
 				size_t sz);
 
+extern void of_parse_phandles(struct device_node *node);
 extern struct device_node *of_parse_phandle(const struct device_node *np,
 					    const char *phandle_name,
 					    int index);
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-12 16:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-12 16:32 [PATCH] OF: base: call of_parse_phandles() from of_unflatten_dtb() Jan Luebbe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox