Skip to content

Commit a3cd45e

Browse files
committed
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.
1 parent b9fda0c commit a3cd45e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

dtmerge/dtoverlay.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,16 @@ int dtoverlay_find_node(DTBLOB_T *dtb, const char *node_path, int path_len)
220220
return fdt_path_offset_namelen(dtb->fdt, node_path, path_len);
221221
}
222222

223+
int dtoverlay_first_subnode(DTBLOB_T *dtb, int node_off)
224+
{
225+
return fdt_first_subnode(dtb->fdt, node_off);
226+
}
227+
228+
int dtoverlay_next_subnode(DTBLOB_T *dtb, int subnode_off)
229+
{
230+
return fdt_next_subnode(dtb->fdt, subnode_off);
231+
}
232+
223233
// Returns 0 on success, otherwise <0 error code
224234
int dtoverlay_set_node_properties(DTBLOB_T *dtb, const char *node_path,
225235
DTOVERLAY_PARAM_T *properties,

dtmerge/dtoverlay.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ int dtoverlay_delete_node(DTBLOB_T *dtb, const char *node_name, int path_len);
114114

115115
int dtoverlay_find_node(DTBLOB_T *dtb, const char *node_path, int path_len);
116116

117+
118+
int dtoverlay_first_subnode(DTBLOB_T *dtb, int node_off);
119+
int dtoverlay_next_subnode(DTBLOB_T *dtb, int subnode_off);
120+
117121
int dtoverlay_set_node_properties(DTBLOB_T *dtb, const char *node_path,
118122
DTOVERLAY_PARAM_T *properties,
119123
unsigned int num_properties);

0 commit comments

Comments
 (0)