summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>2013-07-05 23:19:43 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-07-09 08:55:02 +0200
commitb29eac076911a3bed62702d2670f52e8eda9b44a (patch)
tree4fe8840018c06463d18b8187d6acde657a60ddd3
parentf457f683cb5482e8687c55689864e80ca49e372c (diff)
downloadbarebox-b29eac076911a3bed62702d2670f52e8eda9b44a.tar.gz
barebox-b29eac076911a3bed62702d2670f52e8eda9b44a.tar.xz
OF: base: initalize from node in of_find_node_with_property
This adds initialization of from device node with root_node if NULL is passed. This corresponds to the behavior of all other node iterators. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/of/base.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 07b8cd74d8..769b6426d0 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -400,6 +400,9 @@ struct device_node *of_find_node_with_property(struct device_node *from,
{
struct device_node *np;
+ if (!from)
+ from = root_node;
+
of_tree_for_each_node_from(np, from) {
struct property *pp = of_find_property(np, prop_name, NULL);
if (pp)