[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 37/39] macio: Convert use of qdev_set_parent_bus()
From: |
Markus Armbruster |
Subject: |
[PATCH v3 37/39] macio: Convert use of qdev_set_parent_bus() |
Date: |
Tue, 9 Jun 2020 18:39:30 +0200 |
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>
---
hw/misc/macio/macio.c | 13 ++++++-------
1 file 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);
--
2.26.2
- [PATCH v3 24/39] ssi: Convert last use of ssi_create_slave_no_init() manually, (continued)
- [PATCH v3 24/39] ssi: Convert last use of ssi_create_slave_no_init() manually, Markus Armbruster, 2020/06/09
- [PATCH v3 18/39] isa: New isa_new(), isa_realize_and_unref() etc., Markus Armbruster, 2020/06/09
- [PATCH v3 30/39] qdev: qdev_create(), qdev_try_create() are now unused, drop, Markus Armbruster, 2020/06/09
- [PATCH v3 25/39] ssi: ssi_create_slave_no_init() is now unused, drop, Markus Armbruster, 2020/06/09
- [PATCH v3 19/39] isa: Convert uses of isa_create() with Coccinelle, Markus Armbruster, 2020/06/09
- [PATCH v3 15/39] pci: Convert uses of pci_create() etc. with Coccinelle, Markus Armbruster, 2020/06/09
- [PATCH v3 23/39] ssi: Convert uses of ssi_create_slave_no_init() with Coccinelle, Markus Armbruster, 2020/06/09
- [PATCH v3 08/39] qdev: Convert to qdev_unrealize() manually, Markus Armbruster, 2020/06/09
- [PATCH v3 12/39] qdev: Convert uses of qdev_set_parent_bus() manually, Markus Armbruster, 2020/06/09
- [PATCH v3 32/39] auxbus: New aux_bus_realize(), pairing with aux_bus_init(), Markus Armbruster, 2020/06/09
- [PATCH v3 37/39] macio: Convert use of qdev_set_parent_bus(),
Markus Armbruster <=
- [PATCH v3 35/39] qom: Tidy up a few object_initialize_child() calls, Markus Armbruster, 2020/06/09
- [PATCH v3 26/39] usb: New usb_new(), usb_realize_and_unref(), Markus Armbruster, 2020/06/09
- [PATCH v3 09/39] qdev: Convert uses of qdev_create() with Coccinelle, Markus Armbruster, 2020/06/09
- [PATCH v3 02/39] Revert "hw/prep: realize the PCI root bus as part of the prep init", Markus Armbruster, 2020/06/09
- [PATCH v3 38/39] macio: Eliminate macio_init_child_obj(), Markus Armbruster, 2020/06/09
- [PATCH v3 34/39] auxbus: Eliminate aux_create_slave(), Markus Armbruster, 2020/06/09
- [PATCH v3 28/39] usb: usb_create() is now unused, drop, Markus Armbruster, 2020/06/09
- [PATCH v3 33/39] auxbus: Convert a use of qdev_set_parent_bus(), Markus Armbruster, 2020/06/09
- [PATCH v3 29/39] usb: Eliminate usb_try_create_simple(), Markus Armbruster, 2020/06/09
- [PATCH v3 17/39] pci: pci_create(), pci_create_multifunction() are now unused, drop, Markus Armbruster, 2020/06/09