dtoverlay: Add dtoverlay_first/next_subnode

The dtoverlay wrappers add a DT_BLOB_T type and prevent users having
to import all of libfdt. Add thin veneers of fdt_first_subnode and
fdt_next_subnode.
This commit is contained in:
Phil Elwell
2023-09-19 21:00:24 +01:00
committed by Phil Elwell
parent a1c7f81143
commit 0489c0728e
2 changed files with 14 additions and 0 deletions

View File

@@ -220,6 +220,16 @@ int dtoverlay_find_node(DTBLOB_T *dtb, const char *node_path, int path_len)
return fdt_path_offset_namelen(dtb->fdt, node_path, path_len);
}
int dtoverlay_first_subnode(DTBLOB_T *dtb, int node_off)
{
return fdt_first_subnode(dtb->fdt, node_off);
}
int dtoverlay_next_subnode(DTBLOB_T *dtb, int subnode_off)
{
return fdt_next_subnode(dtb->fdt, subnode_off);
}
// Returns 0 on success, otherwise <0 error code
int dtoverlay_set_node_properties(DTBLOB_T *dtb, const char *node_path,
DTOVERLAY_PARAM_T *properties,

View File

@@ -114,6 +114,10 @@ int dtoverlay_delete_node(DTBLOB_T *dtb, const char *node_name, int path_len);
int dtoverlay_find_node(DTBLOB_T *dtb, const char *node_path, int path_len);
int dtoverlay_first_subnode(DTBLOB_T *dtb, int node_off);
int dtoverlay_next_subnode(DTBLOB_T *dtb, int subnode_off);
int dtoverlay_set_node_properties(DTBLOB_T *dtb, const char *node_path,
DTOVERLAY_PARAM_T *properties,
unsigned int num_properties);