mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: barebox@lists.infradead.org
Subject: [PATCH] OF: base: initalize from node in of_find_node_with_property
Date: Fri,  5 Jul 2013 23:19:43 +0200	[thread overview]
Message-ID: <1373059183-20229-1-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <20130705065043.GG516@pengutronix.de>

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

Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-07-05 21:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03 22:46 [PATCH 0/3] OF: base: fix inifinite looping in node iterators Sebastian Hesselbarth
2013-07-03 22:46 ` [PATCH 1/3] OF: base: fix infinite loop in of_find_node_by_name Sebastian Hesselbarth
2013-07-04  6:58   ` Sascha Hauer
2013-07-04  7:13     ` Sebastian Hesselbarth
2013-07-04 17:12     ` Sebastian Hesselbarth
2013-07-05  6:50       ` Sascha Hauer
2013-07-05 21:19         ` Sebastian Hesselbarth [this message]
2013-07-09  6:55           ` [PATCH] OF: base: initalize from node in of_find_node_with_property Sascha Hauer
2013-07-03 22:46 ` [PATCH 2/3] OF: base: fix infinite loop in of_find_compatible_node Sebastian Hesselbarth
2013-07-03 22:46 ` [PATCH 3/3] OF: base: fix infinite loop in of_find_node_with_property Sebastian Hesselbarth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373059183-20229-1-git-send-email-sebastian.hesselbarth@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox