From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/3] of: move of_find_device_by_node_path to drivers/of/of_path.c
Date: Mon, 28 Apr 2014 11:31:44 +0200 [thread overview]
Message-ID: <1398677505-15869-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1398677505-15869-1-git-send-email-s.hauer@pengutronix.de>
As it's generic helper function which should not stay in driver
specific code.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/of/barebox.c | 14 --------------
drivers/of/of_path.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/of/barebox.c b/drivers/of/barebox.c
index 44ec820..92471f8 100644
--- a/drivers/of/barebox.c
+++ b/drivers/of/barebox.c
@@ -34,20 +34,6 @@ struct of_partition {
static LIST_HEAD(of_partition_list);
-struct device_d *of_find_device_by_node_path(const char *path)
-{
- struct device_d *dev;
-
- for_each_device(dev) {
- if (!dev->device_node)
- continue;
- if (!strcmp(path, dev->device_node->full_name))
- return dev;
- }
-
- return NULL;
-}
-
static int environment_probe(struct device_d *dev)
{
char *path;
diff --git a/drivers/of/of_path.c b/drivers/of/of_path.c
index ab8618e..20eb771 100644
--- a/drivers/of/of_path.c
+++ b/drivers/of/of_path.c
@@ -31,6 +31,20 @@ struct of_path_type {
int (*parse)(struct of_path *op, const char *str);
};
+struct device_d *of_find_device_by_node_path(const char *path)
+{
+ struct device_d *dev;
+
+ for_each_device(dev) {
+ if (!dev->device_node)
+ continue;
+ if (!strcmp(path, dev->device_node->full_name))
+ return dev;
+ }
+
+ return NULL;
+}
+
/**
* of_path_type_partname - find a partition based on physical device and
* partition name
--
1.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-04-28 9:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-28 9:31 [PATCH 1/3] of: partition: set device_node of the newly created partition Sascha Hauer
2014-04-28 9:31 ` Sascha Hauer [this message]
2014-04-28 9:31 ` [PATCH 3/3] of_path: Allow to specify path with phandle only 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=1398677505-15869-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