[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/8] hw/riscv: virt: Switch to use qemu_fdt_setprop_string_arr
From: |
Bin Meng |
Subject: |
[PATCH v2 2/8] hw/riscv: virt: Switch to use qemu_fdt_setprop_string_array() helper |
Date: |
Fri, 30 Apr 2021 15:12:56 +0800 |
From: Bin Meng <bin.meng@windriver.com>
Since commit 78da6a1bca22 ("device_tree: add qemu_fdt_setprop_string_array
helper"),
we can use the new helper to set the compatible strings for the
SiFive test device node.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
Changes in v2:
- use "static const char * const" for compat
hw/riscv/virt.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index c0dc69ff33..992f1c58a9 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -395,8 +395,11 @@ static void create_fdt(RISCVVirtState *s, const
MemMapEntry *memmap,
(long)memmap[VIRT_TEST].base);
qemu_fdt_add_subnode(fdt, name);
{
- const char compat[] = "sifive,test1\0sifive,test0\0syscon";
- qemu_fdt_setprop(fdt, name, "compatible", compat, sizeof(compat));
+ static const char * const compat[3] = {
+ "sifive,test1", "sifive,test0", "syscon"
+ };
+ qemu_fdt_setprop_string_array(fdt, name, "compatible", (char
**)&compat,
+ ARRAY_SIZE(compat));
}
qemu_fdt_setprop_cells(fdt, name, "reg",
0x0, memmap[VIRT_TEST].base,
--
2.25.1
- [PATCH v2 1/8] hw/riscv: sifive_u: Switch to use qemu_fdt_setprop_string_array() helper, Bin Meng, 2021/04/30
- [PATCH v2 2/8] hw/riscv: virt: Switch to use qemu_fdt_setprop_string_array() helper,
Bin Meng <=
- [PATCH v2 3/8] hw/riscv: Support the official CLINT DT bindings, Bin Meng, 2021/04/30
- [PATCH v2 4/8] hw/riscv: Support the official PLIC DT bindings, Bin Meng, 2021/04/30
- [PATCH v2 5/8] docs/system/riscv: Correct the indentation level of supported devices, Bin Meng, 2021/04/30
- [PATCH v2 6/8] docs/system/riscv: sifive_u: Document '-dtb' usage, Bin Meng, 2021/04/30
- [PATCH v2 7/8] hw/riscv: Use macros for BIOS image names, Bin Meng, 2021/04/30
- [PATCH v2 8/8] hw/riscv: microchip_pfsoc: Support direct kernel boot, Bin Meng, 2021/04/30