summaryrefslogtreecommitdiffstats
path: root/drivers/of/of_path.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-04-09 15:19:38 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-04-28 11:30:53 +0200
commit12c7f5d560799ff57cf4acc23f056ad7962a040e (patch)
tree186a0031ecce45573aa11b75a99bcc2f9b18f526 /drivers/of/of_path.c
parent601dcf7644814a3c9dc2a332bbd065d94d133edd (diff)
downloadbarebox-12c7f5d560799ff57cf4acc23f056ad7962a040e.tar.gz
barebox-12c7f5d560799ff57cf4acc23f056ad7962a040e.tar.xz
of: move of_find_device_by_node_path to drivers/of/of_path.c
As it's generic helper function which should not stay in driver specific code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/of/of_path.c')
-rw-r--r--drivers/of/of_path.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/of/of_path.c b/drivers/of/of_path.c
index ab8618e23d..20eb771e6c 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