diff options
author | Rasmus Villemoes <rasmus.villemoes@prevas.dk> | 2023-03-09 11:32:39 +0100 |
---|---|---|
committer | Pierre-Clément Tosi <ptosi@google.com> | 2023-10-11 18:35:43 +0100 |
commit | 8106368cb0a70f327cb2cb411a46eb33cb4bded7 (patch) | |
tree | ec022d2c894a69285160a270501158928772c88f | |
parent | 19db536250d6357c47a75f0d06f691fd025a25c8 (diff) | |
download | dtc-8106368cb0a70f327cb2cb411a46eb33cb4bded7.tar.gz |
FROMGIT: 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>
(cherry-picked from commit 18f5ec12a10ec84e957222074dadf4a3e4cc8d59 git://git.kernel.org/pub/scm/utils/dtc/dtc.git main)
Test: N/A
Change-Id: I43c6ad22dbaa718cd77421a44d5e87d188d26ca0
-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 31f78e2..c7fc486 100644 --- a/libfdt/fdt_ro.c +++ b/libfdt/fdt_ro.c @@ -540,13 +540,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) |