summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-05-26 15:30:28 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-05-30 12:18:28 +0200
commit1f0a3175eca42e7c93465b63bf1e88c6fc88cd43 (patch)
treea0a22084cec99fa6e75df61e15eb5d48905f2c7e /drivers
parentabee214ba54640c8f85ae10dc62d4f90446a9c76 (diff)
downloadbarebox-1f0a3175eca42e7c93465b63bf1e88c6fc88cd43.tar.gz
barebox-1f0a3175eca42e7c93465b63bf1e88c6fc88cd43.tar.xz
of: Add of_alias_get function
This is used to retrieve the name of the alias for a given devicenode. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/base.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 8383549821..8101fb4566 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -212,6 +212,19 @@ int of_alias_get_id(struct device_node *np, const char *stem)
}
EXPORT_SYMBOL_GPL(of_alias_get_id);
+const char *of_alias_get(struct device_node *np)
+{
+ struct property *pp;
+
+ list_for_each_entry(pp, &of_aliases->properties, list) {
+ if (!strcmp(np->full_name, pp->value))
+ return pp->name;
+ }
+
+ return NULL;
+}
+EXPORT_SYMBOL_GPL(of_alias_get);
+
u64 of_translate_address(struct device_node *node, const __be32 *in_addr)
{
struct property *p;