mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jan Luebbe <jlu@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] OF: base: call of_parse_phandles() from of_unflatten_dtb()
Date: Fri, 12 Jul 2013 18:32:05 +0200	[thread overview]
Message-ID: <1373646725-7258-1-git-send-email-jlu@pengutronix.de> (raw)

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

                 reply	other threads:[~2013-07-12 16:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373646725-7258-1-git-send-email-jlu@pengutronix.de \
    --to=jlu@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox