summaryrefslogtreecommitdiffstats
path: root/hw/arm/microbit.c
diff options
context:
space:
mode:
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);