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>
diff --git a/device_tree.c b/device_tree.c
index bba6cc2..f5b4699 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -308,7 +308,7 @@
offset = len;
break;
}
- if (!strcmp(iter_name, name)) {
+ if (!name || !strcmp(iter_name, name)) {
char *path;
path = g_malloc(path_len);