diff options
author | Bin Meng <bin.meng@windriver.com> | 2021-04-30 15:12:56 +0800 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2021-06-08 09:59:42 +1000 |
commit | 2cc04550ac222237b979b5a45679ff746fc99a46 (patch) | |
tree | 41f011c1a8cf7156832ece8dde4ab553fc8f1a85 /hw | |
parent | cb53b283b5adf4123273d07eee5e186e2e0a1b5b (diff) |
hw/riscv: virt: Switch to use qemu_fdt_setprop_string_array() helper
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>
Message-id: 20210430071302.1489082-2-bmeng.cn@gmail.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/riscv/virt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 95a11adaa2..1e017d1c52 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -394,8 +394,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, |