diff options
author | Lucas Stach <dev@lynxeye.de> | 2015-03-03 20:46:13 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-04 11:34:08 +0100 |
commit | 35d5ab939f9e162c1a4c6955b95b2a8ba92cb7ed (patch) | |
tree | 2909636467add7b92b1f7e6348e744e133d827d9 | |
parent | 09c4b63aa20e97011eb109794c7c23faf7ebdce4 (diff) | |
download | barebox-35d5ab939f9e162c1a4c6955b95b2a8ba92cb7ed.tar.gz barebox-35d5ab939f9e162c1a4c6955b95b2a8ba92cb7ed.tar.xz |
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 <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/of/base.c | 8 |
1 files 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; |