aboutsummaryrefslogtreecommitdiff
path: root/hw/misc
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-06-10 07:32:26 +0200
committerMarkus Armbruster <armbru@redhat.com>2020-06-15 22:05:28 +0200
commitf4a0df70a23946011c0e435d66530ff919e73b37 (patch)
tree9aa57e01e4eca8a980f16c53ec5b3a29cabb9283 /hw/misc
parent9fc7fc4d3909817555ce0af6bcb69dff1606140d (diff)
macio: Convert use of qdev_set_parent_bus()
Convert qdev_set_parent_bus()/realize to qdev_realize(); recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains why. Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Cc: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200610053247.1583243-38-armbru@redhat.com>
Diffstat (limited to 'hw/misc')
-rw-r--r--hw/misc/macio/macio.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index a2698e4a20..1a07ca2ca5 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -100,7 +100,6 @@ static void macio_init_child_obj(MacIOState *s, const char *childname,
{
object_initialize_child_with_props(OBJECT(s), childname, child, childsize,
childtype, &error_abort, NULL);
- qdev_set_parent_bus(DEVICE(child), BUS(&s->macio_bus));
}
static void macio_common_realize(PCIDevice *d, Error **errp)
@@ -109,7 +108,7 @@ static void macio_common_realize(PCIDevice *d, Error **errp)
SysBusDevice *sysbus_dev;
Error *err = NULL;
- object_property_set_bool(OBJECT(&s->dbdma), true, "realized", &err);
+ qdev_realize(DEVICE(&s->dbdma), BUS(&s->macio_bus), &err);
if (err) {
error_propagate(errp, err);
return;
@@ -125,7 +124,7 @@ static void macio_common_realize(PCIDevice *d, Error **errp)
qdev_prop_set_chr(DEVICE(&s->escc), "chrB", serial_hd(1));
qdev_prop_set_uint32(DEVICE(&s->escc), "chnBtype", escc_serial);
qdev_prop_set_uint32(DEVICE(&s->escc), "chnAtype", escc_serial);
- object_property_set_bool(OBJECT(&s->escc), true, "realized", &err);
+ qdev_realize(DEVICE(&s->escc), BUS(&s->macio_bus), &err);
if (err) {
error_propagate(errp, err);
return;
@@ -148,7 +147,7 @@ static void macio_realize_ide(MacIOState *s, MACIOIDEState *ide,
object_property_set_link(OBJECT(ide), OBJECT(&s->dbdma), "dbdma", errp);
macio_ide_register_dma(ide);
- object_property_set_bool(OBJECT(ide), true, "realized", errp);
+ qdev_realize(DEVICE(ide), BUS(&s->macio_bus), errp);
}
static void macio_oldworld_realize(PCIDevice *d, Error **errp)
@@ -167,7 +166,7 @@ static void macio_oldworld_realize(PCIDevice *d, Error **errp)
qdev_prop_set_uint64(DEVICE(&s->cuda), "timebase-frequency",
s->frequency);
- object_property_set_bool(OBJECT(&s->cuda), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cuda), BUS(&s->macio_bus), &err);
if (err) {
error_propagate(errp, err);
return;
@@ -184,7 +183,7 @@ static void macio_oldworld_realize(PCIDevice *d, Error **errp)
sysbus_connect_irq(sysbus_dev, 1, qdev_get_gpio_in(pic_dev,
OLDWORLD_ESCCA_IRQ));
- object_property_set_bool(OBJECT(&os->nvram), true, "realized", &err);
+ qdev_realize(DEVICE(&os->nvram), BUS(&s->macio_bus), &err);
if (err) {
error_propagate(errp, err);
return;
@@ -348,7 +347,7 @@ static void macio_newworld_realize(PCIDevice *d, Error **errp)
&error_abort);
memory_region_add_subregion(&s->bar, 0x50,
sysbus_mmio_get_region(sysbus_dev, 0));
- object_property_set_bool(OBJECT(&ns->gpio), true, "realized", &err);
+ qdev_realize(DEVICE(&ns->gpio), BUS(&s->macio_bus), &err);
/* PMU */
object_initialize_child(OBJECT(s), "pmu", &s->pmu, TYPE_VIA_PMU);