diff options
author | Tom Rini <trini@konsulko.com> | 2019-02-11 11:15:34 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-02-11 11:15:34 -0500 |
commit | f94fa0e94f36c740d3c7aa314c89a750c742185b (patch) | |
tree | 42077386d60386628bed02011566ddf990913eb8 /drivers/core/of_access.c | |
parent | f49929772c5ea22e4af987bfb1e5ae13e9895093 (diff) | |
parent | c4bd12a7dad43ed9de3070c7c5e8b690d8c03a79 (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-i2c
- DM I2C improvements
Diffstat (limited to 'drivers/core/of_access.c')
-rw-r--r-- | drivers/core/of_access.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/core/of_access.c b/drivers/core/of_access.c index 14c020a687b..945b81448cc 100644 --- a/drivers/core/of_access.c +++ b/drivers/core/of_access.c @@ -812,6 +812,24 @@ int of_alias_get_id(const struct device_node *np, const char *stem) return id; } +int of_alias_get_highest_id(const char *stem) +{ + struct alias_prop *app; + int id = -1; + + mutex_lock(&of_mutex); + list_for_each_entry(app, &aliases_lookup, link) { + if (strcmp(app->stem, stem) != 0) + continue; + + if (app->id > id) + id = app->id; + } + mutex_unlock(&of_mutex); + + return id; +} + struct device_node *of_get_stdout(void) { return of_stdout; |