[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 28/31] device_tree: Allow name wildcards in qemu_fdt_node_path()
From: |
Peter Maydell |
Subject: |
[PULL 28/31] device_tree: Allow name wildcards in qemu_fdt_node_path() |
Date: |
Thu, 30 Apr 2020 12:51:39 +0100 |
From: "Edgar E. Iglesias" <address@hidden>
Allow name wildcards in qemu_fdt_node_path(). This is useful
to find all nodes with a given compatibility string.
Reviewed-by: Alistair Francis <address@hidden>
Signed-off-by: Edgar E. Iglesias <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
---
include/sysemu/device_tree.h | 3 +++
device_tree.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h
index c16fd69bc0b..7c53ef76345 100644
--- a/include/sysemu/device_tree.h
+++ b/include/sysemu/device_tree.h
@@ -39,6 +39,9 @@ void *load_device_tree_from_sysfs(void);
* 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
* 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,
Error **errp);
diff --git a/device_tree.c b/device_tree.c
index bba6cc21641..f5b4699aedb 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -308,7 +308,7 @@ char **qemu_fdt_node_path(void *fdt, const char *name, char
*compat,
offset = len;
break;
}
- if (!strcmp(iter_name, name)) {
+ if (!name || !strcmp(iter_name, name)) {
char *path;
path = g_malloc(path_len);
--
2.20.1
- [PULL 17/31] qdev-monitor: print the device's clock with info qtree, (continued)
- [PULL 17/31] qdev-monitor: print the device's clock with info qtree, Peter Maydell, 2020/04/30
- [PULL 22/31] hw/arm/virt: dt: move creation of /secure-chosen to create_fdt(), Peter Maydell, 2020/04/30
- [PULL 21/31] target/arm: Vectorize integer comparison vs zero, Peter Maydell, 2020/04/30
- [PULL 23/31] hw/arm/virt: dt: add kaslr-seed property, Peter Maydell, 2020/04/30
- [PULL 24/31] target/arm: Restrict the Address Translate write operation to TCG accel, Peter Maydell, 2020/04/30
- [PULL 25/31] target/arm: Make cpu_register() available for other files, Peter Maydell, 2020/04/30
- [PULL 26/31] target/arm/cpu: Use ARRAY_SIZE() to iterate over ARMCPUInfo[], Peter Maydell, 2020/04/30
- [PULL 27/31] target/arm/cpu: Update coding style to make checkpatch.pl happy, Peter Maydell, 2020/04/30
- [PULL 28/31] device_tree: Allow name wildcards in qemu_fdt_node_path(),
Peter Maydell <=
- [PULL 29/31] device_tree: Constify compat in qemu_fdt_node_path(), Peter Maydell, 2020/04/30
- [PULL 31/31] hw/arm: xlnx-zcu102: Disable unsupported FDT firmware nodes, Peter Maydell, 2020/04/30
- [PULL 30/31] hw/arm: xlnx-zcu102: Move arm_boot_info into XlnxZCU102, Peter Maydell, 2020/04/30
- Re: [PULL 00/31] target-arm queue, no-reply, 2020/04/30