diff options
author | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2013-07-05 23:19:43 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-09 08:55:02 +0200 |
commit | b29eac076911a3bed62702d2670f52e8eda9b44a (patch) | |
tree | 4fe8840018c06463d18b8187d6acde657a60ddd3 | |
parent | f457f683cb5482e8687c55689864e80ca49e372c (diff) | |
download | barebox-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.c | 3 |
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) |