mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Rob Herring <robherring2@gmail.com>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Srinivas Kandagatla <srinivas.kandagatla@st.com>,
	Timur Tabi <timur@freescale.com>
Subject: linux-next: manual merge of the dt-rh tree with Linus' tree
Date: Tue, 2 Oct 2012 13:50:59 +1000	[thread overview]
Message-ID: <20121002135059.3b97bb158fcb6417daa3a7ae@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 3179 bytes --]

Hi Rob,

Today's linux-next merge of the dt-rh tree got a conflict in
drivers/of/base.c include/linux/of.h between commit 3296193d1421 ("dt:
introduce for_each_available_child_of_node, of_get_next_available_child")
from Linus' tree and commit 9c19761a7ecd ("dt: introduce
of_get_child_by_name to get child node by name") from the dt-rh tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/of/base.c
index 4a8d46f,e2e8136..0000000
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@@ -364,33 -364,29 +364,56 @@@ struct device_node *of_get_next_child(c
  EXPORT_SYMBOL(of_get_next_child);
  
  /**
 + *	of_get_next_available_child - Find the next available child node
 + *	@node:	parent node
 + *	@prev:	previous child of the parent node, or NULL to get first
 + *
 + *      This function is like of_get_next_child(), except that it
 + *      automatically skips any disabled nodes (i.e. status = "disabled").
 + */
 +struct device_node *of_get_next_available_child(const struct device_node *node,
 +	struct device_node *prev)
 +{
 +	struct device_node *next;
 +
 +	read_lock(&devtree_lock);
 +	next = prev ? prev->sibling : node->child;
 +	for (; next; next = next->sibling) {
 +		if (!of_device_is_available(next))
 +			continue;
 +		if (of_node_get(next))
 +			break;
 +	}
 +	of_node_put(prev);
 +	read_unlock(&devtree_lock);
 +	return next;
 +}
 +EXPORT_SYMBOL(of_get_next_available_child);
 +
 +/**
+  *	of_get_child_by_name - Find the child node by name for a given parent
+  *	@node:	parent node
+  *	@name:	child name to look for.
+  *
+  *      This function looks for child node for given matching name
+  *
+  *	Returns a node pointer if found, with refcount incremented, use
+  *	of_node_put() on it when done.
+  *	Returns NULL if node is not found.
+  */
+ struct device_node *of_get_child_by_name(const struct device_node *node,
+ 				const char *name)
+ {
+ 	struct device_node *child;
+ 
+ 	for_each_child_of_node(node, child)
+ 		if (child->name && (of_node_cmp(child->name, name) == 0))
+ 			break;
+ 	return child;
+ }
+ EXPORT_SYMBOL(of_get_child_by_name);
+ 
+ /**
   *	of_find_node_by_path - Find a node matching a full OF path
   *	@path:	The full path to match
   *
diff --cc include/linux/of.h
index 5c7a158,fabb524..0000000
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@@ -190,9 -190,8 +190,11 @@@ extern struct device_node *of_get_paren
  extern struct device_node *of_get_next_parent(struct device_node *node);
  extern struct device_node *of_get_next_child(const struct device_node *node,
  					     struct device_node *prev);
 +extern struct device_node *of_get_next_available_child(
 +	const struct device_node *node, struct device_node *prev);
 +
+ extern struct device_node *of_get_child_by_name(const struct device_node *node,
+ 					const char *name);
  #define for_each_child_of_node(parent, child) \
  	for (child = of_get_next_child(parent, NULL); child != NULL; \
  	     child = of_get_next_child(parent, child))

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

             reply	other threads:[~2012-10-02  3:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02  3:50 Stephen Rothwell [this message]
2014-05-13  5:10 Stephen Rothwell

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=20121002135059.3b97bb158fcb6417daa3a7ae@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=robherring2@gmail.com \
    --cc=srinivas.kandagatla@st.com \
    --cc=timur@freescale.com \
    /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

all inboxes | Powered by JetHome®