aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/microbit.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-06-10 07:32:38 +0200
committerMarkus Armbruster <armbru@redhat.com>2020-06-15 22:06:04 +0200
commit5a147c8c51d42fcdf5befc2982715b4b407f612e (patch)
tree74c0340ac0e1d8cc99dab09f08db45e5ea6bab37 /hw/arm/microbit.c
parentdb873cc5d1a4aaa67eea87768d504b2f89d88738 (diff)
sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 3
These are init/realize pairs produced by the previous commit's Coccinelle script where the argument test doesn't quite match. They need even more careful review. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200610053247.1583243-50-armbru@redhat.com>
Diffstat (limited to 'hw/arm/microbit.c')
-rw-r--r--hw/arm/microbit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c
index 72fab429c4..d20ebd3aad 100644
--- a/hw/arm/microbit.c
+++ b/hw/arm/microbit.c
@@ -39,21 +39,21 @@ static void microbit_init(MachineState *machine)
Object *soc = OBJECT(&s->nrf51);
Object *i2c = OBJECT(&s->i2c);
- sysbus_init_child_obj(OBJECT(machine), "nrf51", &s->nrf51, sizeof(s->nrf51),
- TYPE_NRF51_SOC);
+ object_initialize_child(OBJECT(machine), "nrf51", &s->nrf51,
+ TYPE_NRF51_SOC);
qdev_prop_set_chr(DEVICE(&s->nrf51), "serial0", serial_hd(0));
object_property_set_link(soc, OBJECT(system_memory), "memory",
&error_fatal);
- object_property_set_bool(soc, true, "realized", &error_fatal);
+ sysbus_realize(SYS_BUS_DEVICE(soc), &error_fatal);
/*
* Overlap the TWI stub device into the SoC. This is a microbit-specific
* hack until we implement the nRF51 TWI controller properly and the
* magnetometer/accelerometer devices.
*/
- sysbus_init_child_obj(OBJECT(machine), "microbit.twi", &s->i2c,
- sizeof(s->i2c), TYPE_MICROBIT_I2C);
- object_property_set_bool(i2c, true, "realized", &error_fatal);
+ object_initialize_child(OBJECT(machine), "microbit.twi", &s->i2c,
+ TYPE_MICROBIT_I2C);
+ sysbus_realize(SYS_BUS_DEVICE(i2c), &error_fatal);
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(i2c), 0);
memory_region_add_subregion_overlap(&s->nrf51.container, NRF51_TWI_BASE,
mr, -1);