diff options
author | Rasmus Villemoes <rasmus.villemoes@prevas.dk> | 2023-03-09 11:32:39 +0100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2023-05-03 23:51:02 +1000 |
commit | 18f5ec12a10ec84e957222074dadf4a3e4cc8d59 (patch) | |
tree | 3100c95a3241b6830ca60fef5389b17600e0e704 | |
parent | df093279282ca0cff4d20ceb3bb5857117ed4cc4 (diff) | |
download | device-tree-compiler-18f5ec12a10ec84e957222074dadf4a3e4cc8d59.tar.gz |
use fdt_path_getprop_namelen() in fdt_get_alias_namelen()
Simplify the code by making use of the new helper.
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r-- | libfdt/fdt_ro.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c index cc2fd88..7faa7a6 100644 --- a/libfdt/fdt_ro.c +++ b/libfdt/fdt_ro.c @@ -537,13 +537,7 @@ static const void *fdt_path_getprop_namelen(const void *fdt, const char *path, const char *fdt_get_alias_namelen(const void *fdt, const char *name, int namelen) { - int aliasoffset; - - aliasoffset = fdt_path_offset(fdt, "/aliases"); - if (aliasoffset < 0) - return NULL; - - return fdt_getprop_namelen(fdt, aliasoffset, name, namelen, NULL); + return fdt_path_getprop_namelen(fdt, "/aliases", name, namelen, NULL); } const char *fdt_get_alias(const void *fdt, const char *name) |