aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/msf2-soc.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/arm/msf2-soc.c')
-rw-r--r--hw/arm/msf2-soc.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c
index 3235c76194..16bb7c9916 100644
--- a/hw/arm/msf2-soc.c
+++ b/hw/arm/msf2-soc.c
@@ -93,7 +93,6 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
MSF2State *s = MSF2_SOC(dev_soc);
DeviceState *dev, *armv7m;
SysBusDevice *busdev;
- Error *err = NULL;
int i;
MemoryRegion *system_memory = get_system_memory();
@@ -123,11 +122,9 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
qdev_prop_set_uint32(armv7m, "num-irq", 81);
qdev_prop_set_string(armv7m, "cpu-type", s->cpu_type);
qdev_prop_set_bit(armv7m, "enable-bitband", true);
- object_property_set_link(OBJECT(&s->armv7m), OBJECT(get_system_memory()),
- "memory", &error_abort);
- sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), &err);
- if (err != NULL) {
- error_propagate(errp, err);
+ object_property_set_link(OBJECT(&s->armv7m), "memory",
+ OBJECT(get_system_memory()), &error_abort);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), errp)) {
return;
}
@@ -153,9 +150,7 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
dev = DEVICE(&s->timer);
/* APB0 clock is the timer input clock */
qdev_prop_set_uint32(dev, "clock-frequency", s->m3clk / s->apb0div);
- sysbus_realize(SYS_BUS_DEVICE(&s->timer), &err);
- if (err != NULL) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer), errp)) {
return;
}
busdev = SYS_BUS_DEVICE(dev);
@@ -168,9 +163,7 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
dev = DEVICE(&s->sysreg);
qdev_prop_set_uint32(dev, "apb0divisor", s->apb0div);
qdev_prop_set_uint32(dev, "apb1divisor", s->apb1div);
- sysbus_realize(SYS_BUS_DEVICE(&s->sysreg), &err);
- if (err != NULL) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->sysreg), errp)) {
return;
}
busdev = SYS_BUS_DEVICE(dev);
@@ -179,9 +172,7 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
for (i = 0; i < MSF2_NUM_SPIS; i++) {
gchar *bus_name;
- sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err);
- if (err != NULL) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), errp)) {
return;
}
@@ -197,11 +188,9 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
}
dev = DEVICE(&s->emac);
- object_property_set_link(OBJECT(&s->emac), OBJECT(get_system_memory()),
- "ahb-bus", &error_abort);
- sysbus_realize(SYS_BUS_DEVICE(&s->emac), &err);
- if (err != NULL) {
- error_propagate(errp, err);
+ object_property_set_link(OBJECT(&s->emac), "ahb-bus",
+ OBJECT(get_system_memory()), &error_abort);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->emac), errp)) {
return;
}
busdev = SYS_BUS_DEVICE(dev);