@@ -158,14 +158,22 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
for (i = 0; i < AW_A10_NUM_USB; i++) {
object_property_set_bool(OBJECT(&s->ehci[i]), true, "realized",
- &error_fatal);
+ &err);
+ if (err) {
+ error_propagate(errp, err);
+ return;
+ }
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ehci[i]), 0,
AW_A10_EHCI_BASE + i * 0x8000);
sysbus_connect_irq(SYS_BUS_DEVICE(&s->ehci[i]), 0,
qdev_get_gpio_in(dev, 39 + i));
object_property_set_bool(OBJECT(&s->ohci[i]), true, "realized",
- &error_fatal);
+ &err);
+ if (err) {
+ error_propagate(errp, err);
+ return;
+ }
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ohci[i]), 0,
AW_A10_OHCI_BASE + i * 0x8000);
sysbus_connect_irq(SYS_BUS_DEVICE(&s->ohci[i]), 0,
@@ -178,7 +186,11 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
sysbus_mmio_map(SYS_BUS_DEVICE(&s->mmc0), 0, AW_A10_MMC0_BASE);
sysbus_connect_irq(SYS_BUS_DEVICE(&s->mmc0), 0, qdev_get_gpio_in(dev, 32));
object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->mmc0),
- "sd-bus", &error_abort);
+ "sd-bus", &err);
+ if (err) {
+ error_propagate(errp, err);
+ return;
+ }
/* RTC */
qdev_init_nofail(DEVICE(&s->rtc));
Patch created mechanically by running: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/use-error_propagate-in-realize.cocci \ --keep-comments --smpl-spacing --in-place --dir hw Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- hw/arm/allwinner-a10.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)