[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 76/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle,
From: |
Markus Armbruster |
Subject: |
[PULL 76/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 4 |
Date: |
Mon, 15 Jun 2020 22:40:00 +0200 |
This is still the same transformation as in the previous commits, but
here the sysbus_init_child_obj() and its matching realize in are in
separate files. Fortunately, there's just one realize left to
convert.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-51-armbru@redhat.com>
---
hw/arm/aspeed_ast2600.c | 10 ++++------
hw/arm/aspeed_soc.c | 4 ++--
hw/sd/aspeed_sdhci.c | 2 +-
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
index 7c39adb272..d465743247 100644
--- a/hw/arm/aspeed_ast2600.c
+++ b/hw/arm/aspeed_ast2600.c
@@ -200,9 +200,8 @@ static void aspeed_soc_ast2600_init(Object *obj)
/* Init sd card slot class here so that they're under the correct parent */
for (i = 0; i < ASPEED_SDHCI_NUM_SLOTS; ++i) {
- sysbus_init_child_obj(obj, "sd-controller.sdhci[*]",
- &s->sdhci.slots[i],
- sizeof(s->sdhci.slots[i]), TYPE_SYSBUS_SDHCI);
+ object_initialize_child(obj, "sd-controller.sdhci[*]",
+ &s->sdhci.slots[i], TYPE_SYSBUS_SDHCI);
}
object_initialize_child(obj, "emmc-controller", &s->emmc,
@@ -210,9 +209,8 @@ static void aspeed_soc_ast2600_init(Object *obj)
object_property_set_int(OBJECT(&s->emmc), 1, "num-slots", &error_abort);
- sysbus_init_child_obj(obj, "emmc-controller.sdhci",
- &s->emmc.slots[0], sizeof(s->emmc.slots[0]),
- TYPE_SYSBUS_SDHCI);
+ object_initialize_child(obj, "emmc-controller.sdhci", &s->emmc.slots[0],
+ TYPE_SYSBUS_SDHCI);
}
/*
diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
index c40839c1fb..d1e48b7a5d 100644
--- a/hw/arm/aspeed_soc.c
+++ b/hw/arm/aspeed_soc.c
@@ -208,8 +208,8 @@ static void aspeed_soc_init(Object *obj)
/* Init sd card slot class here so that they're under the correct parent */
for (i = 0; i < ASPEED_SDHCI_NUM_SLOTS; ++i) {
- sysbus_init_child_obj(obj, "sdhci[*]", &s->sdhci.slots[i],
- sizeof(s->sdhci.slots[i]), TYPE_SYSBUS_SDHCI);
+ object_initialize_child(obj, "sdhci[*]", &s->sdhci.slots[i],
+ TYPE_SYSBUS_SDHCI);
}
}
diff --git a/hw/sd/aspeed_sdhci.c b/hw/sd/aspeed_sdhci.c
index 6a039a1d2f..538d3bad3d 100644
--- a/hw/sd/aspeed_sdhci.c
+++ b/hw/sd/aspeed_sdhci.c
@@ -145,7 +145,7 @@ static void aspeed_sdhci_realize(DeviceState *dev, Error
**errp)
return;
}
- object_property_set_bool(sdhci_slot, true, "realized", &err);
+ sysbus_realize(sbd_slot, &err);
if (err) {
error_propagate(errp, err);
return;
--
2.26.2
- [PULL 13/84] pnv/phb4: Delete unused "pnv-phb4-pec-stack" devices, (continued)
- [PULL 13/84] pnv/phb4: Delete unused "pnv-phb4-pec-stack" devices, Markus Armbruster, 2020/06/15
- [PULL 55/84] usb: Eliminate usb_try_create_simple(), Markus Armbruster, 2020/06/15
- [PULL 63/84] macio: Convert use of qdev_set_parent_bus(), Markus Armbruster, 2020/06/15
- [PULL 84/84] MAINTAINERS: Make section QOM cover hw/core/*bus.c as well, Markus Armbruster, 2020/06/15
- [PULL 74/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 2, Markus Armbruster, 2020/06/15
- [PULL 28/84] Revert "hw/prep: realize the PCI root bus as part of the prep init", Markus Armbruster, 2020/06/15
- [PULL 81/84] qdev: Use qdev_realize() in qdev_device_add(), Markus Armbruster, 2020/06/15
- [PULL 12/84] macio: Delete unused "macio-gpio" devices, Markus Armbruster, 2020/06/15
- [PULL 78/84] microbit: Eliminate two local variables in microbit_init(), Markus Armbruster, 2020/06/15
- [PULL 80/84] qdev: Make qdev_realize() support bus-less devices, Markus Armbruster, 2020/06/15
- [PULL 76/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 4,
Markus Armbruster <=
- [PULL 70/84] sysbus: New sysbus_realize(), sysbus_realize_and_unref(), Markus Armbruster, 2020/06/15
- [PULL 67/84] sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 1, Markus Armbruster, 2020/06/15
- [PULL 82/84] qdev: Convert bus-less devices to qdev_realize() with Coccinelle, Markus Armbruster, 2020/06/15
- [PULL 79/84] s390x/event-facility: Simplify creation of SCLP event devices, Markus Armbruster, 2020/06/15
- [PULL 48/84] ssi: ssi_auto_connect_slaves() never does anything, drop, Markus Armbruster, 2020/06/15
- [PULL 61/84] qom: Tidy up a few object_initialize_child() calls, Markus Armbruster, 2020/06/15
- [PULL 60/84] auxbus: Eliminate aux_create_slave(), Markus Armbruster, 2020/06/15
- [PULL 59/84] auxbus: Convert a use of qdev_set_parent_bus(), Markus Armbruster, 2020/06/15
- [PULL 75/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 3, Markus Armbruster, 2020/06/15
- [PULL 62/84] qom: Less verbose object_initialize_child(), Markus Armbruster, 2020/06/15