diff options
author | Michal Simek <michal.simek@xilinx.com> | 2019-01-31 18:30:59 +0300 |
---|---|---|
committer | Heiko Schocher <hs@denx.de> | 2019-02-08 08:25:32 +0300 |
commit | 83e4c7e9ffa57fe4116967999c223c952a46a78a (patch) | |
tree | e02bb6b75e64b116d0d9011a1762e033000004ea /drivers/core | |
parent | 003c9dc89176cacc9996f737d08490805e29582e (diff) | |
download | u-boot-83e4c7e9ffa57fe4116967999c223c952a46a78a.tar.xz |
dm: core: Introduce dev_read_alias_highest_id()
It is wrapper for calling of_alias_get_highest_id() when live tree is
enabled and fdtdec_get_alias_highest_id() if not.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r-- | drivers/core/read.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/core/read.c b/drivers/core/read.c index 3c46b3674e..6bda077a34 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -264,3 +264,11 @@ u64 dev_translate_address(struct udevice *dev, const fdt32_t *in_addr) { return ofnode_translate_address(dev_ofnode(dev), in_addr); } + +int dev_read_alias_highest_id(const char *stem) +{ + if (of_live_active()) + return of_alias_get_highest_id(stem); + + return fdtdec_get_alias_highest_id(gd->fdt_blob, stem); +} |