1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-11-01 10:56:02 +01:00

dm: core: Add support for getting node from aliases

Add support for getting a node/property from aliases.
The similar functionality is provided for chosen node and this
implemenatation is copy of it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Michal Simek
2020-07-28 12:51:08 +02:00
parent c94b44c64b
commit 305d31885f
3 changed files with 66 additions and 0 deletions

View File

@@ -476,6 +476,28 @@ ofnode ofnode_get_chosen_node(const char *name)
return ofnode_path(prop);
}
const void *ofnode_read_aliases_prop(const char *propname, int *sizep)
{
ofnode node;
node = ofnode_path("/aliases");
return ofnode_read_prop(node, propname, sizep);
}
ofnode ofnode_get_aliases_node(const char *name)
{
const char *prop;
prop = ofnode_read_aliases_prop(name, NULL);
if (!prop)
return ofnode_null();
debug("%s: node_path: %s\n", __func__, prop);
return ofnode_path(prop);
}
int ofnode_get_child_count(ofnode parent)
{
ofnode child;