[PATCH 06/16] of: return root node when looking for a node with path /

Sascha Hauer s.hauer at pengutronix.de
Fri Jan 11 08:24:26 EST 2013


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/of/base.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 3e91e36..69fbf9a 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -491,6 +491,9 @@ struct device_node *of_find_node_by_path(const char *path)
 {
 	struct device_node *np;
 
+	if (!strcmp(path, "/"))
+		return root_node;
+
 	list_for_each_entry(np, &allnodes, list) {
 		if (np->full_name && (strcmp(np->full_name, path) == 0))
 			return np;
-- 
1.7.10.4




More information about the barebox mailing list