device_tree: Allow name wildcards in qemu_fdt_node_path()
Allow name wildcards in qemu_fdt_node_path(). This is useful to find all nodes with a given compatibility string. Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Message-id: 20200423121114.4274-2-edgar.iglesias@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
51c510aa58
commit
80972d3bb2
|
@ -308,7 +308,7 @@ char **qemu_fdt_node_path(void *fdt, const char *name, char *compat,
|
||||||
offset = len;
|
offset = len;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!strcmp(iter_name, name)) {
|
if (!name || !strcmp(iter_name, name)) {
|
||||||
char *path;
|
char *path;
|
||||||
|
|
||||||
path = g_malloc(path_len);
|
path = g_malloc(path_len);
|
||||||
|
|
|
@ -39,6 +39,9 @@ void *load_device_tree_from_sysfs(void);
|
||||||
* NULL. If there is no error but no matching node was found, the
|
* NULL. If there is no error but no matching node was found, the
|
||||||
* returned array contains a single element equal to NULL. If an error
|
* returned array contains a single element equal to NULL. If an error
|
||||||
* was encountered when parsing the blob, the function returns NULL
|
* was encountered when parsing the blob, the function returns NULL
|
||||||
|
*
|
||||||
|
* @name may be NULL to wildcard names and only match compatibility
|
||||||
|
* strings.
|
||||||
*/
|
*/
|
||||||
char **qemu_fdt_node_path(void *fdt, const char *name, char *compat,
|
char **qemu_fdt_node_path(void *fdt, const char *name, char *compat,
|
||||||
Error **errp);
|
Error **errp);
|
||||||
|
|
Loading…
Reference in New Issue