summaryrefslogtreecommitdiffstats
path: root/hw/arm
diff options
context:
space:
mode:
authorMarkus Armbruster2020-06-10 07:32:45 +0200
committerMarkus Armbruster2020-06-15 22:06:04 +0200
commitce189ab230bd3472ada876bf7568221342ee6dbb (patch)
treee1a1c5287c96cdd7b9100c06df7bc9ea4daa18ab /hw/arm
parentqdev: Use qdev_realize() in qdev_device_add() (diff)
downloadqemu-ce189ab230bd3472ada876bf7568221342ee6dbb.tar.gz
qemu-ce189ab230bd3472ada876bf7568221342ee6dbb.tar.xz
qemu-ce189ab230bd3472ada876bf7568221342ee6dbb.zip
qdev: Convert bus-less devices to qdev_realize() with Coccinelle
All remaining conversions to qdev_realize() are for bus-less devices. Coccinelle script: // only correct for bus-less @dev! @@ expression errp; expression dev; @@ - qdev_init_nofail(dev); + qdev_realize(dev, NULL, &error_fatal); @ depends on !(file in "hw/core/qdev.c") && !(file in "hw/core/bus.c")@ expression errp; expression dev; symbol true; @@ - object_property_set_bool(OBJECT(dev), true, "realized", errp); + qdev_realize(DEVICE(dev), NULL, errp); @ depends on !(file in "hw/core/qdev.c") && !(file in "hw/core/bus.c")@ expression errp; expression dev; symbol true; @@ - object_property_set_bool(dev, true, "realized", errp); + qdev_realize(DEVICE(dev), NULL, errp); Note that Coccinelle chokes on ARMSSE typedef vs. macro in hw/arm/armsse.c. Worked around by temporarily renaming the macro for the spatch run. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200610053247.1583243-57-armbru@redhat.com>
Diffstat (limited to 'hw/arm')
-rw-r--r--hw/arm/allwinner-a10.c2
-rw-r--r--hw/arm/allwinner-h3.c2
-rw-r--r--hw/arm/armsse.c20
-rw-r--r--hw/arm/armv7m.c2
-rw-r--r--hw/arm/aspeed.c3
-rw-r--r--hw/arm/aspeed_ast2600.c2
-rw-r--r--hw/arm/aspeed_soc.c2
-rw-r--r--hw/arm/bcm2836.c3
-rw-r--r--hw/arm/cubieboard.c2
-rw-r--r--hw/arm/digic.c2
-rw-r--r--hw/arm/digic_boards.c2
-rw-r--r--hw/arm/exynos4210.c4
-rw-r--r--hw/arm/fsl-imx25.c2
-rw-r--r--hw/arm/fsl-imx31.c2
-rw-r--r--hw/arm/fsl-imx6.c2
-rw-r--r--hw/arm/fsl-imx6ul.c3
-rw-r--r--hw/arm/fsl-imx7.c2
-rw-r--r--hw/arm/highbank.c2
-rw-r--r--hw/arm/imx25_pdk.c2
-rw-r--r--hw/arm/integratorcp.c2
-rw-r--r--hw/arm/kzm.c2
-rw-r--r--hw/arm/mcimx6ul-evk.c2
-rw-r--r--hw/arm/mcimx7d-sabre.c2
-rw-r--r--hw/arm/mps2-tz.c9
-rw-r--r--hw/arm/mps2.c7
-rw-r--r--hw/arm/musca.c6
-rw-r--r--hw/arm/orangepi.c2
-rw-r--r--hw/arm/raspi.c2
-rw-r--r--hw/arm/realview.c2
-rw-r--r--hw/arm/sabrelite.c2
-rw-r--r--hw/arm/sbsa-ref.c2
-rw-r--r--hw/arm/stm32f205_soc.c2
-rw-r--r--hw/arm/stm32f405_soc.c2
-rw-r--r--hw/arm/versatilepb.c2
-rw-r--r--hw/arm/vexpress.c2
-rw-r--r--hw/arm/virt.c2
-rw-r--r--hw/arm/xilinx_zynq.c2
-rw-r--r--hw/arm/xlnx-versal.c2
-rw-r--r--hw/arm/xlnx-zcu102.c2
-rw-r--r--hw/arm/xlnx-zynqmp.c10
40 files changed, 56 insertions, 71 deletions
diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c
index e05099c757..52e0d83760 100644
--- a/hw/arm/allwinner-a10.c
+++ b/hw/arm/allwinner-a10.c
@@ -74,7 +74,7 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
SysBusDevice *sysbusdev;
Error *err = NULL;
- object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu), NULL, &err);
if (err != NULL) {
error_propagate(errp, err);
return;
diff --git a/hw/arm/allwinner-h3.c b/hw/arm/allwinner-h3.c
index 91d22640e4..8e09468e86 100644
--- a/hw/arm/allwinner-h3.c
+++ b/hw/arm/allwinner-h3.c
@@ -250,7 +250,7 @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp)
qdev_prop_set_bit(DEVICE(&s->cpus[i]), "has_el2", true);
/* Mark realized */
- qdev_init_nofail(DEVICE(&s->cpus[i]));
+ qdev_realize(DEVICE(&s->cpus[i]), NULL, &error_fatal);
}
/* Generic Interrupt Controller */
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index 8abe1307a9..9ddde339ec 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -584,8 +584,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
* CPU must exist and have been parented into the cluster before
* the cluster is realized.
*/
- object_property_set_bool(OBJECT(&s->cluster[i]),
- true, "realized", &err);
+ qdev_realize(DEVICE(&s->cluster[i]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -621,7 +620,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(splitter, true, "realized", &err);
+ qdev_realize(DEVICE(splitter), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -677,8 +676,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(OBJECT(&s->sec_resp_splitter), true,
- "realized", &err);
+ qdev_realize(DEVICE(&s->sec_resp_splitter), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -729,8 +727,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(OBJECT(&s->mpc_irq_orgate), true,
- "realized", &err);
+ qdev_realize(DEVICE(&s->mpc_irq_orgate), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -889,8 +886,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(OBJECT(&s->ppc_irq_orgate), true,
- "realized", &err);
+ qdev_realize(DEVICE(&s->ppc_irq_orgate), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -1065,7 +1061,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(OBJECT(&s->nmi_orgate), true, "realized", &err);
+ qdev_realize(DEVICE(&s->nmi_orgate), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -1113,7 +1109,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(splitter, true, "realized", &err);
+ qdev_realize(DEVICE(splitter), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -1160,7 +1156,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(OBJECT(splitter), true, "realized", &err);
+ qdev_realize(DEVICE(splitter), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index 5cdd0b9b51..ce83586e03 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -216,7 +216,7 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
s->cpu->env.nvic = &s->nvic;
s->nvic.cpu = s->cpu;
- object_property_set_bool(OBJECT(s->cpu), true, "realized", &err);
+ qdev_realize(DEVICE(s->cpu), NULL, &err);
if (err != NULL) {
error_propagate(errp, err);
return;
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 46fe6fecc2..0ad08a2b4c 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -302,8 +302,7 @@ static void aspeed_machine_init(MachineState *machine)
object_property_set_int(OBJECT(&bmc->soc), ASPEED_SCU_PROT_KEY,
"hw-prot-key", &error_abort);
}
- object_property_set_bool(OBJECT(&bmc->soc), true, "realized",
- &error_abort);
+ qdev_realize(DEVICE(&bmc->soc), NULL, &error_abort);
memory_region_add_subregion(get_system_memory(),
sc->memmap[ASPEED_SDRAM],
diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
index d465743247..6da687299f 100644
--- a/hw/arm/aspeed_ast2600.c
+++ b/hw/arm/aspeed_ast2600.c
@@ -259,7 +259,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
* is needed when using -kernel
*/
- object_property_set_bool(OBJECT(&s->cpu[i]), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu[i]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
index d1e48b7a5d..810cf9b6cc 100644
--- a/hw/arm/aspeed_soc.c
+++ b/hw/arm/aspeed_soc.c
@@ -230,7 +230,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
/* CPU */
for (i = 0; i < sc->num_cpus; i++) {
- object_property_set_bool(OBJECT(&s->cpu[i]), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu[i]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c
index 39a63f2565..ed1793f7b7 100644
--- a/hw/arm/bcm2836.c
+++ b/hw/arm/bcm2836.c
@@ -133,8 +133,7 @@ static void bcm2836_realize(DeviceState *dev, Error **errp)
return;
}
- object_property_set_bool(OBJECT(&s->cpu[n].core), true,
- "realized", &err);
+ qdev_realize(DEVICE(&s->cpu[n].core), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c
index 4bc4f08caf..a96c860575 100644
--- a/hw/arm/cubieboard.c
+++ b/hw/arm/cubieboard.c
@@ -80,7 +80,7 @@ static void cubieboard_init(MachineState *machine)
exit(1);
}
- object_property_set_bool(OBJECT(a10), true, "realized", &err);
+ qdev_realize(DEVICE(a10), NULL, &err);
if (err != NULL) {
error_reportf_err(err, "Couldn't realize Allwinner A10: ");
exit(1);
diff --git a/hw/arm/digic.c b/hw/arm/digic.c
index 13acd2cf6e..13a83f7430 100644
--- a/hw/arm/digic.c
+++ b/hw/arm/digic.c
@@ -62,7 +62,7 @@ static void digic_realize(DeviceState *dev, Error **errp)
return;
}
- object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu), NULL, &err);
if (err != NULL) {
error_propagate(errp, err);
return;
diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
index 518a63e61d..b6452d918c 100644
--- a/hw/arm/digic_boards.c
+++ b/hw/arm/digic_boards.c
@@ -62,7 +62,7 @@ static void digic4_board_init(MachineState *machine, DigicBoard *board)
exit(EXIT_FAILURE);
}
- object_property_set_bool(OBJECT(s), true, "realized", &err);
+ qdev_realize(DEVICE(s), NULL, &err);
if (err != NULL) {
error_reportf_err(err, "Couldn't realize DIGIC SoC: ");
exit(1);
diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c
index 2afeb73776..b888a5c9ab 100644
--- a/hw/arm/exynos4210.c
+++ b/hw/arm/exynos4210.c
@@ -190,7 +190,7 @@ static DeviceState *pl330_create(uint32_t base, qemu_or_irq *orgate,
object_property_set_int(OBJECT(orgate), nevents + 1, "num-lines",
&error_abort);
- object_property_set_bool(OBJECT(orgate), true, "realized", &error_abort);
+ qdev_realize(DEVICE(orgate), NULL, &error_abort);
for (i = 0; i < nevents + 1; i++) {
sysbus_connect_irq(busdev, i, qdev_get_gpio_in(DEVICE(orgate), i));
@@ -223,7 +223,7 @@ static void exynos4210_realize(DeviceState *socdev, Error **errp)
"mp-affinity", &error_abort);
object_property_set_int(cpuobj, EXYNOS4210_SMP_PRIVATE_BASE_ADDR,
"reset-cbar", &error_abort);
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
}
/*** IRQs ***/
diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c
index d2c4970074..fb516bdbac 100644
--- a/hw/arm/fsl-imx25.c
+++ b/hw/arm/fsl-imx25.c
@@ -85,7 +85,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
uint8_t i;
Error *err = NULL;
- object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c
index 08236c3230..42cca529c3 100644
--- a/hw/arm/fsl-imx31.c
+++ b/hw/arm/fsl-imx31.c
@@ -66,7 +66,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
uint16_t i;
Error *err = NULL;
- object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
index 33b1be4000..17593485b7 100644
--- a/hw/arm/fsl-imx6.c
+++ b/hw/arm/fsl-imx6.c
@@ -130,7 +130,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
"start-powered-off", &error_abort);
}
- object_property_set_bool(OBJECT(&s->cpu[i]), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu[i]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
index 72142cc2b6..f8c564033e 100644
--- a/hw/arm/fsl-imx6ul.c
+++ b/hw/arm/fsl-imx6ul.c
@@ -168,8 +168,7 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
object_property_set_int(OBJECT(&s->cpu), QEMU_PSCI_CONDUIT_SMC,
"psci-conduit", &error_abort);
- object_property_set_bool(OBJECT(&s->cpu), true,
- "realized", &error_abort);
+ qdev_realize(DEVICE(&s->cpu), NULL, &error_abort);
/*
* A7MPCORE
diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c
index aa7051307d..ca8b5cc358 100644
--- a/hw/arm/fsl-imx7.c
+++ b/hw/arm/fsl-imx7.c
@@ -174,7 +174,7 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
"start-powered-off", &error_abort);
}
- object_property_set_bool(o, true, "realized", &error_abort);
+ qdev_realize(DEVICE(o), NULL, &error_abort);
}
/*
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index 7f279d7f93..c7ef48ecde 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -280,7 +280,7 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
object_property_set_int(cpuobj, MPCORE_PERIPHBASE,
"reset-cbar", &error_abort);
}
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
cpu_irq[n] = qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_IRQ);
cpu_fiq[n] = qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_FIQ);
cpu_virq[n] = qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_VIRQ);
diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c
index 69b95711e4..af8f7f969c 100644
--- a/hw/arm/imx25_pdk.c
+++ b/hw/arm/imx25_pdk.c
@@ -75,7 +75,7 @@ static void imx25_pdk_init(MachineState *machine)
object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_FSL_IMX25);
- object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
/* We need to initialize our memory */
if (machine->ram_size > (FSL_IMX25_SDRAM0_SIZE + FSL_IMX25_SDRAM1_SIZE)) {
diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index a55d2c31e3..b11a846355 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -607,7 +607,7 @@ static void integratorcp_init(MachineState *machine)
object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
}
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
cpu = ARM_CPU(cpuobj);
diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c
index 0275d63079..e3f7d4ead2 100644
--- a/hw/arm/kzm.c
+++ b/hw/arm/kzm.c
@@ -73,7 +73,7 @@ static void kzm_init(MachineState *machine)
object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_FSL_IMX31);
- object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
/* Check the amount of memory is compatible with the SOC */
if (machine->ram_size > (FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE)) {
diff --git a/hw/arm/mcimx6ul-evk.c b/hw/arm/mcimx6ul-evk.c
index 769fe6d802..3d1d2e3c04 100644
--- a/hw/arm/mcimx6ul-evk.c
+++ b/hw/arm/mcimx6ul-evk.c
@@ -40,7 +40,7 @@ static void mcimx6ul_evk_init(MachineState *machine)
s = FSL_IMX6UL(object_new(TYPE_FSL_IMX6UL));
object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
- object_property_set_bool(OBJECT(s), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(s), NULL, &error_fatal);
memory_region_add_subregion(get_system_memory(), FSL_IMX6UL_MMDC_ADDR,
machine->ram);
diff --git a/hw/arm/mcimx7d-sabre.c b/hw/arm/mcimx7d-sabre.c
index 645ad5470f..365f8183bc 100644
--- a/hw/arm/mcimx7d-sabre.c
+++ b/hw/arm/mcimx7d-sabre.c
@@ -42,7 +42,7 @@ static void mcimx7d_sabre_init(MachineState *machine)
s = FSL_IMX7(object_new(TYPE_FSL_IMX7));
object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
- object_property_set_bool(OBJECT(s), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(s), NULL, &error_fatal);
memory_region_add_subregion(get_system_memory(), FSL_IMX7_MMDC_ADDR,
machine->ram);
diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
index a2b20fff37..8155c35418 100644
--- a/hw/arm/mps2-tz.c
+++ b/hw/arm/mps2-tz.c
@@ -414,8 +414,7 @@ static void mps2tz_common_init(MachineState *machine)
object_property_set_int(OBJECT(splitter), 2, "num-lines",
&error_fatal);
- object_property_set_bool(OBJECT(splitter), true, "realized",
- &error_fatal);
+ qdev_realize(DEVICE(splitter), NULL, &error_fatal);
qdev_connect_gpio_out(DEVICE(splitter), 0,
qdev_get_gpio_in_named(DEVICE(&mms->iotkit),
"EXP_IRQ", i));
@@ -433,8 +432,7 @@ static void mps2tz_common_init(MachineState *machine)
object_property_set_int(OBJECT(&mms->sec_resp_splitter),
ARRAY_SIZE(mms->ppc) + ARRAY_SIZE(mms->msc),
"num-lines", &error_fatal);
- object_property_set_bool(OBJECT(&mms->sec_resp_splitter), true,
- "realized", &error_fatal);
+ qdev_realize(DEVICE(&mms->sec_resp_splitter), NULL, &error_fatal);
dev_splitter = DEVICE(&mms->sec_resp_splitter);
qdev_connect_gpio_out_named(iotkitdev, "sec_resp_cfg", 0,
qdev_get_gpio_in(dev_splitter, 0));
@@ -466,8 +464,7 @@ static void mps2tz_common_init(MachineState *machine)
&mms->uart_irq_orgate, TYPE_OR_IRQ);
object_property_set_int(OBJECT(&mms->uart_irq_orgate), 10, "num-lines",
&error_fatal);
- object_property_set_bool(OBJECT(&mms->uart_irq_orgate), true,
- "realized", &error_fatal);
+ qdev_realize(DEVICE(&mms->uart_irq_orgate), NULL, &error_fatal);
qdev_connect_gpio_out(DEVICE(&mms->uart_irq_orgate), 0,
get_sse_irq_in(mms, 15));
diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
index 735f44c7a3..daa55f730b 100644
--- a/hw/arm/mps2.c
+++ b/hw/arm/mps2.c
@@ -229,7 +229,7 @@ static void mps2_common_init(MachineState *machine)
orgate = object_new(TYPE_OR_IRQ);
object_property_set_int(orgate, 6, "num-lines", &error_fatal);
- object_property_set_bool(orgate, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(orgate), NULL, &error_fatal);
orgate_dev = DEVICE(orgate);
qdev_connect_gpio_out(orgate_dev, 0, qdev_get_gpio_in(armv7m, 12));
@@ -266,7 +266,7 @@ static void mps2_common_init(MachineState *machine)
orgate = object_new(TYPE_OR_IRQ);
object_property_set_int(orgate, 10, "num-lines", &error_fatal);
- object_property_set_bool(orgate, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(orgate), NULL, &error_fatal);
orgate_dev = DEVICE(orgate);
qdev_connect_gpio_out(orgate_dev, 0, qdev_get_gpio_in(armv7m, 12));
@@ -281,8 +281,7 @@ static void mps2_common_init(MachineState *machine)
txrx_orgate = object_new(TYPE_OR_IRQ);
object_property_set_int(txrx_orgate, 2, "num-lines", &error_fatal);
- object_property_set_bool(txrx_orgate, true, "realized",
- &error_fatal);
+ qdev_realize(DEVICE(txrx_orgate), NULL, &error_fatal);
txrx_orgate_dev = DEVICE(txrx_orgate);
qdev_connect_gpio_out(txrx_orgate_dev, 0,
qdev_get_gpio_in(armv7m, uart_txrx_irqno[i]));
diff --git a/hw/arm/musca.c b/hw/arm/musca.c
index d74042356d..34376328fc 100644
--- a/hw/arm/musca.c
+++ b/hw/arm/musca.c
@@ -405,8 +405,7 @@ static void musca_init(MachineState *machine)
object_property_set_int(OBJECT(splitter), 2, "num-lines",
&error_fatal);
- object_property_set_bool(OBJECT(splitter), true, "realized",
- &error_fatal);
+ qdev_realize(DEVICE(splitter), NULL, &error_fatal);
qdev_connect_gpio_out(DEVICE(splitter), 0,
qdev_get_gpio_in_named(ssedev, "EXP_IRQ", i));
qdev_connect_gpio_out(DEVICE(splitter), 1,
@@ -425,8 +424,7 @@ static void musca_init(MachineState *machine)
object_property_set_int(OBJECT(&mms->sec_resp_splitter),
ARRAY_SIZE(mms->ppc), "num-lines", &error_fatal);
- object_property_set_bool(OBJECT(&mms->sec_resp_splitter), true,
- "realized", &error_fatal);
+ qdev_realize(DEVICE(&mms->sec_resp_splitter), NULL, &error_fatal);
dev_splitter = DEVICE(&mms->sec_resp_splitter);
qdev_connect_gpio_out_named(ssedev, "sec_resp_cfg", 0,
qdev_get_gpio_in(dev_splitter, 0));
diff --git a/hw/arm/orangepi.c b/hw/arm/orangepi.c
index 44a333a6eb..678c93033e 100644
--- a/hw/arm/orangepi.c
+++ b/hw/arm/orangepi.c
@@ -86,7 +86,7 @@ static void orangepi_init(MachineState *machine)
&error_abort);
/* Mark H3 object realized */
- object_property_set_bool(OBJECT(h3), true, "realized", &error_abort);
+ qdev_realize(DEVICE(h3), NULL, &error_abort);
/* Retrieve SD bus */
di = drive_get_next(IF_SD);
diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
index 78cb995251..380978fc27 100644
--- a/hw/arm/raspi.c
+++ b/hw/arm/raspi.c
@@ -287,7 +287,7 @@ static void raspi_machine_init(MachineState *machine)
object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(machine->ram));
object_property_set_int(OBJECT(&s->soc), board_rev, "board-rev",
&error_abort);
- object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_abort);
+ qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
/* Create and plug in the SD cards */
di = drive_get_next(IF_SD);
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index aee7989037..f3c00fe00c 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -114,7 +114,7 @@ static void realview_init(MachineState *machine,
&error_fatal);
}
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
cpu_irq[n] = qdev_get_gpio_in(DEVICE(cpuobj), ARM_CPU_IRQ);
}
diff --git a/hw/arm/sabrelite.c b/hw/arm/sabrelite.c
index 33d731549d..a27e5baf60 100644
--- a/hw/arm/sabrelite.c
+++ b/hw/arm/sabrelite.c
@@ -51,7 +51,7 @@ static void sabrelite_init(MachineState *machine)
s = FSL_IMX6(object_new(TYPE_FSL_IMX6));
object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
- object_property_set_bool(OBJECT(s), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(s), NULL, &error_fatal);
memory_region_add_subregion(get_system_memory(), FSL_IMX6_MMDC_ADDR,
machine->ram);
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 3fd3536796..e40c868a82 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -680,7 +680,7 @@ static void sbsa_ref_init(MachineState *machine)
object_property_set_link(cpuobj, OBJECT(secure_sysmem),
"secure-memory", &error_abort);
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
object_unref(cpuobj);
}
diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c
index e2c3479702..19487544f0 100644
--- a/hw/arm/stm32f205_soc.c
+++ b/hw/arm/stm32f205_soc.c
@@ -155,7 +155,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
/* ADC 1 to 3 */
object_property_set_int(OBJECT(s->adc_irqs), STM_NUM_ADCS,
"num-lines", &err);
- object_property_set_bool(OBJECT(s->adc_irqs), true, "realized", &err);
+ qdev_realize(DEVICE(s->adc_irqs), NULL, &err);
if (err != NULL) {
error_propagate(errp, err);
return;
diff --git a/hw/arm/stm32f405_soc.c b/hw/arm/stm32f405_soc.c
index 9f7838a4a3..c12d9f999d 100644
--- a/hw/arm/stm32f405_soc.c
+++ b/hw/arm/stm32f405_soc.c
@@ -173,7 +173,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp)
}
object_property_set_int(OBJECT(&s->adc_irqs), STM_NUM_ADCS,
"num-lines", &err);
- object_property_set_bool(OBJECT(&s->adc_irqs), true, "realized", &err);
+ qdev_realize(DEVICE(&s->adc_irqs), NULL, &err);
if (err != NULL) {
error_propagate(errp, err);
return;
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index 29e3bc6bd0..2ebdcbd8ac 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -215,7 +215,7 @@ static void versatile_init(MachineState *machine, int board_id)
object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
}
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
cpu = ARM_CPU(cpuobj);
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index bebb0ed5a4..7ca5d523a4 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -229,7 +229,7 @@ static void init_cpus(MachineState *ms, const char *cpu_type,
object_property_set_int(cpuobj, periphbase,
"reset-cbar", &error_abort);
}
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
}
/* Create the private peripheral devices (including the GIC);
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index c3e80bcbce..caceb1e4a0 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1819,7 +1819,7 @@ static void machvirt_init(MachineState *machine)
"secure-memory", &error_abort);
}
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
object_unref(cpuobj);
}
fdt_add_timer_nodes(vms);
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index 69d62ee24b..4247c4dbd8 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -202,7 +202,7 @@ static void zynq_init(MachineState *machine)
&error_fatal);
object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
&error_fatal);
- object_property_set_bool(OBJECT(cpu), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpu), NULL, &error_fatal);
/* DDR remapped to address zero. */
memory_region_add_subregion(address_space_mem, 0, machine->ram);
diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
index 20f0121ab0..fed9d07ca2 100644
--- a/hw/arm/xlnx-versal.c
+++ b/hw/arm/xlnx-versal.c
@@ -47,7 +47,7 @@ static void versal_create_apu_cpus(Versal *s)
"core-count", &error_abort);
object_property_set_link(obj, OBJECT(&s->fpd.apu.mr), "memory",
&error_abort);
- object_property_set_bool(obj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(obj), NULL, &error_fatal);
}
}
diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c
index 822e24af65..b920bcee94 100644
--- a/hw/arm/xlnx-zcu102.c
+++ b/hw/arm/xlnx-zcu102.c
@@ -125,7 +125,7 @@ static void xlnx_zcu102_init(MachineState *machine)
object_property_set_bool(OBJECT(&s->soc), s->virt, "virtualization",
&error_fatal);
- object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
/* Create and plug in the SD cards */
for (i = 0; i < XLNX_ZYNQMP_NUM_SDHCI; i++) {
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 446b75a7aa..1de9d4a89d 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -209,15 +209,14 @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s,
object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "reset-hivecs",
&error_abort);
- object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "realized",
- &err);
+ qdev_realize(DEVICE(&s->rpu_cpu[i]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
}
}
- qdev_init_nofail(DEVICE(&s->rpu_cluster));
+ qdev_realize(DEVICE(&s->rpu_cluster), NULL, &error_fatal);
}
static void xlnx_zynqmp_init(Object *obj)
@@ -341,7 +340,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
qdev_prop_set_bit(DEVICE(&s->gic),
"has-virtualization-extensions", s->virt);
- qdev_init_nofail(DEVICE(&s->apu_cluster));
+ qdev_realize(DEVICE(&s->apu_cluster), NULL, &error_fatal);
/* Realize APUs before realizing the GIC. KVM requires this. */
for (i = 0; i < num_apus; i++) {
@@ -368,8 +367,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
"reset-cbar", &error_abort);
object_property_set_int(OBJECT(&s->apu_cpu[i]), num_apus,
"core-count", &error_abort);
- object_property_set_bool(OBJECT(&s->apu_cpu[i]), true, "realized",
- &err);
+ qdev_realize(DEVICE(&s->apu_cpu[i]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;