Browse Source

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 2 years ago committed by David Gibson
parent
commit
18f5ec12a1
  1. 8
      libfdt/fdt_ro.c

8
libfdt/fdt_ro.c

@ -537,13 +537,7 @@ static const void *fdt_path_getprop_namelen(const void *fdt, const char *path, @@ -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)

Loading…
Cancel
Save