From b29eac076911a3bed62702d2670f52e8eda9b44a Mon Sep 17 00:00:00 2001 From: Sebastian Hesselbarth Date: Fri, 5 Jul 2013 23:19:43 +0200 Subject: 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 Signed-off-by: Sascha Hauer --- drivers/of/base.c | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit v1.2.3