mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 01/13] of: base: implement of_get_next_child
Date: Thu,  9 Jul 2015 09:24:05 +0200	[thread overview]
Message-ID: <1436426657-5266-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1436426657-5266-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/of/base.c | 17 +++++++++++++++++
 include/of.h      |  8 ++++++++
 2 files changed, 25 insertions(+)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 3e40a48..0eb1d6b 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1570,6 +1570,23 @@ struct device_node *of_get_next_available_child(const struct device_node *node,
 EXPORT_SYMBOL(of_get_next_available_child);
 
 /**
+ *	of_get_next_child - Iterate a node childs
+ *	@node:  parent node
+ *	@prev:  previous child of the parent node, or NULL to get first
+ *
+ *	Returns a node pointer with refcount incremented.
+ */
+struct device_node *of_get_next_child(const struct device_node *node,
+	struct device_node *prev)
+{
+	prev = list_prepare_entry(prev, &node->children, parent_list);
+	list_for_each_entry_continue(prev, &node->children, parent_list)
+		return prev;
+	return NULL;
+}
+EXPORT_SYMBOL(of_get_next_available_child);
+
+/**
  *	of_get_child_count - Count child nodes of given parent node
  *	@parent:	parent node
  *
diff --git a/include/of.h b/include/of.h
index 1db210b..e0ebc39 100644
--- a/include/of.h
+++ b/include/of.h
@@ -153,6 +153,8 @@ extern int of_device_is_available(const struct device_node *device);
 extern struct device_node *of_get_parent(const struct device_node *node);
 extern struct device_node *of_get_next_available_child(
 	const struct device_node *node, struct device_node *prev);
+struct device_node *of_get_next_child(const struct device_node *node,
+	struct device_node *prev);
 extern int of_get_child_count(const struct device_node *parent);
 extern int of_get_available_child_count(const struct device_node *parent);
 extern struct device_node *of_get_child_by_name(const struct device_node *node,
@@ -308,6 +310,12 @@ static inline struct device_node *of_get_next_available_child(
 	return NULL;
 }
 
+static inline struct device_node *of_get_next_child(const struct device_node *node,
+	struct device_node *prev)
+{
+	return NULL;
+}
+
 static inline int of_get_child_count(const struct device_node *parent)
 {
 	return -ENOSYS;
-- 
2.1.4


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

  reply	other threads:[~2015-07-09  7:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09  7:24 Video support for EfikaSB Sascha Hauer
2015-07-09  7:24 ` Sascha Hauer [this message]
2015-07-09  7:24 ` [PATCH 02/13] of: import of_graph functions Sascha Hauer
2015-07-09  7:24 ` [PATCH 03/13] of_graph: add of_graph_port_is_available Sascha Hauer
2015-07-09  7:24 ` [PATCH 04/13] ARM: i.MX51 Efikasb: Disable backlight earlier Sascha Hauer
2015-07-09  7:24 ` [PATCH 05/13] ARM: i.MX51 Efikasb: make more space for barebox Sascha Hauer
2015-07-09  7:24 ` [PATCH 06/13] ARM: i.MX51 Efikasb: update device tree Sascha Hauer
2015-07-09  7:24 ` [PATCH 07/13] video: Add Video Pipeline (VPL) support Sascha Hauer
2015-07-09  7:24 ` [PATCH 08/13] video: Add MTL017 LVDS encoder support Sascha Hauer
2015-07-09  7:24 ` [PATCH 09/13] video: Add missing prototype for display_timings_release Sascha Hauer
2015-07-09  7:24 ` [PATCH 10/13] video: ipuv3: remove unused variable Sascha Hauer
2015-07-09  7:24 ` [PATCH 11/13] video: ipuv3: Replace ipu_output with VPL Sascha Hauer
2015-07-09  7:24 ` [PATCH 12/13] video: ipuv3: match ipu_di_signal_cfg's clk_pol with its description Sascha Hauer
2015-07-09  7:24 ` [PATCH 13/13] video: Add simple-panel support Sascha Hauer

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=1436426657-5266-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --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