lib: utils: Extend fdt_find_match() Implementation

We extend fdt_find_match() implementation by adding node offset
parameter which represents the first node to match from.

The improved fdt_find_match() can be used to find multiple
match nodes.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
Anup Patel
2020-05-12 13:59:52 +05:30
committed by Anup Patel
parent 446a9c6d1e
commit 2c685c214f
8 changed files with 11 additions and 9 deletions

View File

@@ -43,7 +43,8 @@ const struct fdt_match *fdt_match_node(void *fdt, int nodeoff,
return NULL;
}
int fdt_find_match(void *fdt, const struct fdt_match *match_table,
int fdt_find_match(void *fdt, int startoff,
const struct fdt_match *match_table,
const struct fdt_match **out_match)
{
int nodeoff;
@@ -52,7 +53,7 @@ int fdt_find_match(void *fdt, const struct fdt_match *match_table,
return SBI_ENODEV;
while (match_table->compatible) {
nodeoff = fdt_node_offset_by_compatible(fdt, -1,
nodeoff = fdt_node_offset_by_compatible(fdt, startoff,
match_table->compatible);
if (nodeoff >= 0) {
if (out_match)