From 35d5ab939f9e162c1a4c6955b95b2a8ba92cb7ed Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Tue, 3 Mar 2015 20:46:13 +0100 Subject: of: make of_alias_get work on all types of DT paths of_alias_get assumed that a DT path is always the full node path, whic is not necessarily the case, as there are other valid path descriptions. All of them are handled by of_find_node_by_path. As there is already a preparsed list with all DT aliases that handles this case properly we can simply reuse that one. Signed-off-by: Lucas Stach Signed-off-by: Sascha Hauer --- drivers/of/base.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index af10fd1da3..b77d8799bb 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -227,11 +227,11 @@ EXPORT_SYMBOL_GPL(of_alias_get_id); const char *of_alias_get(struct device_node *np) { - struct property *pp; + struct alias_prop *app; - list_for_each_entry(pp, &of_aliases->properties, list) { - if (!of_node_cmp(np->full_name, pp->value)) - return pp->name; + list_for_each_entry(app, &aliases_lookup, link) { + if (np == app->np) + return app->alias; } return NULL; -- cgit v1.2.3