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>
main
Rasmus Villemoes 2023-03-09 11:32:39 +01:00 committed by David Gibson
parent df09327928
commit 18f5ec12a1
1 changed files with 1 additions and 7 deletions

View File

@ -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)