[PATCH] OF: base: initalize from node in of_find_node_with_property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
@Sascha: this is the last remaining iterator fix we talked about.

Cc: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
Cc: barebox@xxxxxxxxxxxxxxxxxxx
---
 drivers/of/base.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 5440f40..7bee912 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -364,6 +364,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)
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux