aboutsummaryrefslogtreecommitdiff
path: root/hw/microblaze/xlnx-zynqmp-pmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/microblaze/xlnx-zynqmp-pmu.c')
-rw-r--r--hw/microblaze/xlnx-zynqmp-pmu.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pmu.c
index 30ad133ec3..e74b047380 100644
--- a/hw/microblaze/xlnx-zynqmp-pmu.c
+++ b/hw/microblaze/xlnx-zynqmp-pmu.c
@@ -63,14 +63,12 @@ static void xlnx_zynqmp_pmu_soc_init(Object *obj)
object_initialize_child(obj, "pmu-cpu", &s->cpu, TYPE_MICROBLAZE_CPU);
- sysbus_init_child_obj(obj, "intc", &s->intc, sizeof(s->intc),
- TYPE_XLNX_PMU_IO_INTC);
+ object_initialize_child(obj, "intc", &s->intc, TYPE_XLNX_PMU_IO_INTC);
/* Create the IPI device */
for (int i = 0; i < XLNX_ZYNQMP_PMU_NUM_IPIS; i++) {
char *name = g_strdup_printf("ipi%d", i);
- sysbus_init_child_obj(obj, name, &s->ipi[i], sizeof(s->ipi[i]),
- TYPE_XLNX_ZYNQMP_IPI);
+ object_initialize_child(obj, name, &s->ipi[i], TYPE_XLNX_ZYNQMP_IPI);
g_free(name);
}
}
@@ -110,7 +108,7 @@ static void xlnx_zynqmp_pmu_soc_realize(DeviceState *dev, Error **errp)
&error_abort);
object_property_set_uint(OBJECT(&s->intc), 0xffff, "intc-positive",
&error_abort);
- object_property_set_bool(OBJECT(&s->intc), true, "realized", &err);
+ sysbus_realize(SYS_BUS_DEVICE(&s->intc), &err);
if (err) {
error_propagate(errp, err);
return;
@@ -121,8 +119,7 @@ static void xlnx_zynqmp_pmu_soc_realize(DeviceState *dev, Error **errp)
/* Connect the IPI device */
for (int i = 0; i < XLNX_ZYNQMP_PMU_NUM_IPIS; i++) {
- object_property_set_bool(OBJECT(&s->ipi[i]), true, "realized",
- &error_abort);
+ sysbus_realize(SYS_BUS_DEVICE(&s->ipi[i]), &error_abort);
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ipi[i]), 0, ipi_addr[i]);
sysbus_connect_irq(SYS_BUS_DEVICE(&s->ipi[i]), 0,
qdev_get_gpio_in(DEVICE(&s->intc), ipi_irq[i]));