diff options
Diffstat (limited to 'hw/arm')
-rw-r--r-- | hw/arm/allwinner-a10.c | 15 | ||||
-rw-r--r-- | hw/arm/armsse.c | 78 | ||||
-rw-r--r-- | hw/arm/armv7m.c | 9 | ||||
-rw-r--r-- | hw/arm/aspeed_ast2600.c | 51 | ||||
-rw-r--r-- | hw/arm/aspeed_soc.c | 45 | ||||
-rw-r--r-- | hw/arm/bcm2835_peripherals.c | 45 | ||||
-rw-r--r-- | hw/arm/bcm2836.c | 9 | ||||
-rw-r--r-- | hw/arm/cubieboard.c | 3 | ||||
-rw-r--r-- | hw/arm/digic.c | 9 | ||||
-rw-r--r-- | hw/arm/digic_boards.c | 3 | ||||
-rw-r--r-- | hw/arm/fsl-imx25.c | 33 | ||||
-rw-r--r-- | hw/arm/fsl-imx31.c | 24 | ||||
-rw-r--r-- | hw/arm/fsl-imx6.c | 36 | ||||
-rw-r--r-- | hw/arm/msf2-soc.c | 15 | ||||
-rw-r--r-- | hw/arm/nrf51_soc.c | 18 | ||||
-rw-r--r-- | hw/arm/stm32f205_soc.c | 21 | ||||
-rw-r--r-- | hw/arm/stm32f405_soc.c | 24 | ||||
-rw-r--r-- | hw/arm/xlnx-zynqmp.c | 45 |
18 files changed, 161 insertions, 322 deletions
diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c index 52e0d83760..e1acffe5f6 100644 --- a/hw/arm/allwinner-a10.c +++ b/hw/arm/allwinner-a10.c @@ -74,14 +74,12 @@ static void aw_a10_realize(DeviceState *dev, Error **errp) SysBusDevice *sysbusdev; Error *err = NULL; - qdev_realize(DEVICE(&s->cpu), NULL, &err); - if (err != NULL) { + if (!qdev_realize(DEVICE(&s->cpu), NULL, &err)) { error_propagate(errp, err); return; } - sysbus_realize(SYS_BUS_DEVICE(&s->intc), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->intc), &err)) { error_propagate(errp, err); return; } @@ -93,8 +91,7 @@ static void aw_a10_realize(DeviceState *dev, Error **errp) qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ)); qdev_pass_gpios(DEVICE(&s->intc), dev, NULL); - sysbus_realize(SYS_BUS_DEVICE(&s->timer), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer), &err)) { error_propagate(errp, err); return; } @@ -117,8 +114,7 @@ static void aw_a10_realize(DeviceState *dev, Error **errp) qemu_check_nic_model(&nd_table[0], TYPE_AW_EMAC); qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]); } - sysbus_realize(SYS_BUS_DEVICE(&s->emac), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->emac), &err)) { error_propagate(errp, err); return; } @@ -126,8 +122,7 @@ static void aw_a10_realize(DeviceState *dev, Error **errp) sysbus_mmio_map(sysbusdev, 0, AW_A10_EMAC_BASE); sysbus_connect_irq(sysbusdev, 0, qdev_get_gpio_in(dev, 55)); - sysbus_realize(SYS_BUS_DEVICE(&s->sata), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->sata), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c index 2fbd970b4f..9a48bf86c3 100644 --- a/hw/arm/armsse.c +++ b/hw/arm/armsse.c @@ -565,8 +565,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) object_property_set_link(cpuobj, OBJECT(&s->cpu_container[i]), "memory", &error_abort); object_property_set_link(cpuobj, OBJECT(s), "idau", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(cpuobj), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(cpuobj), &err)) { error_propagate(errp, err); return; } @@ -576,8 +575,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) * CPU must exist and have been parented into the cluster before * the cluster is realized. */ - qdev_realize(DEVICE(&s->cluster[i]), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->cluster[i]), NULL, &err)) { error_propagate(errp, err); return; } @@ -612,8 +610,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } - qdev_realize(DEVICE(splitter), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(splitter), NULL, &err)) { error_propagate(errp, err); return; } @@ -645,8 +642,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) } /* Security controller */ - sysbus_realize(SYS_BUS_DEVICE(&s->secctl), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->secctl), &err)) { error_propagate(errp, err); return; } @@ -668,8 +664,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } - qdev_realize(DEVICE(&s->sec_resp_splitter), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->sec_resp_splitter), NULL, &err)) { error_propagate(errp, err); return; } @@ -692,8 +687,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) } object_property_set_link(OBJECT(&s->mpc[i]), OBJECT(&s->sram[i]), "downstream", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->mpc[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->mpc[i]), &err)) { error_propagate(errp, err); return; } @@ -715,8 +709,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } - qdev_realize(DEVICE(&s->mpc_irq_orgate), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->mpc_irq_orgate), NULL, &err)) { error_propagate(errp, err); return; } @@ -734,8 +727,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) * map its upstream ends to the right place in the container. */ qdev_prop_set_uint32(DEVICE(&s->timer0), "pclk-frq", s->mainclk_frq); - sysbus_realize(SYS_BUS_DEVICE(&s->timer0), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer0), &err)) { error_propagate(errp, err); return; } @@ -746,8 +738,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) &error_abort); qdev_prop_set_uint32(DEVICE(&s->timer1), "pclk-frq", s->mainclk_frq); - sysbus_realize(SYS_BUS_DEVICE(&s->timer1), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer1), &err)) { error_propagate(errp, err); return; } @@ -758,8 +749,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) &error_abort); qdev_prop_set_uint32(DEVICE(&s->dualtimer), "pclk-frq", s->mainclk_frq); - sysbus_realize(SYS_BUS_DEVICE(&s->dualtimer), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->dualtimer), &err)) { error_propagate(errp, err); return; } @@ -784,8 +774,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) int cpunum; SysBusDevice *mhu_sbd = SYS_BUS_DEVICE(&s->mhu[i]); - sysbus_realize(SYS_BUS_DEVICE(&s->mhu[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->mhu[i]), &err)) { error_propagate(errp, err); return; } @@ -811,8 +800,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) } } - sysbus_realize(SYS_BUS_DEVICE(&s->apb_ppc0), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->apb_ppc0), &err)) { error_propagate(errp, err); return; } @@ -860,8 +848,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } - qdev_realize(DEVICE(&s->ppc_irq_orgate), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->ppc_irq_orgate), NULL, &err)) { error_propagate(errp, err); return; } @@ -883,8 +870,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) qdev_prop_set_string(DEVICE(&s->cachectrl[i]), "name", name); g_free(name); qdev_prop_set_uint64(DEVICE(&s->cachectrl[i]), "size", 0x1000); - sysbus_realize(SYS_BUS_DEVICE(&s->cachectrl[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->cachectrl[i]), &err)) { error_propagate(errp, err); return; } @@ -901,8 +887,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) qdev_prop_set_string(DEVICE(&s->cpusecctrl[i]), "name", name); g_free(name); qdev_prop_set_uint64(DEVICE(&s->cpusecctrl[i]), "size", 0x1000); - sysbus_realize(SYS_BUS_DEVICE(&s->cpusecctrl[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpusecctrl[i]), &err)) { error_propagate(errp, err); return; } @@ -916,8 +901,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) MemoryRegion *mr; qdev_prop_set_uint32(DEVICE(&s->cpuid[i]), "CPUID", i); - sysbus_realize(SYS_BUS_DEVICE(&s->cpuid[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpuid[i]), &err)) { error_propagate(errp, err); return; } @@ -932,8 +916,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) * 0x4002f000: S32K timer */ qdev_prop_set_uint32(DEVICE(&s->s32ktimer), "pclk-frq", S32KCLK); - sysbus_realize(SYS_BUS_DEVICE(&s->s32ktimer), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->s32ktimer), &err)) { error_propagate(errp, err); return; } @@ -943,8 +926,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) object_property_set_link(OBJECT(&s->apb_ppc1), OBJECT(mr), "port[0]", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->apb_ppc1), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->apb_ppc1), &err)) { error_propagate(errp, err); return; } @@ -981,8 +963,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } - sysbus_realize(SYS_BUS_DEVICE(&s->sysinfo), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->sysinfo), &err)) { error_propagate(errp, err); return; } @@ -997,8 +978,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) "INITSVTOR0_RST", &error_abort); object_property_set_int(OBJECT(&s->sysctl), s->init_svtor, "INITSVTOR1_RST", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->sysctl), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->sysctl), &err)) { error_propagate(errp, err); return; } @@ -1032,8 +1012,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } - qdev_realize(DEVICE(&s->nmi_orgate), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->nmi_orgate), NULL, &err)) { error_propagate(errp, err); return; } @@ -1041,8 +1020,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) qdev_get_gpio_in_named(DEVICE(&s->armv7m), "NMI", 0)); qdev_prop_set_uint32(DEVICE(&s->s32kwatchdog), "wdogclk-frq", S32KCLK); - sysbus_realize(SYS_BUS_DEVICE(&s->s32kwatchdog), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->s32kwatchdog), &err)) { error_propagate(errp, err); return; } @@ -1053,8 +1031,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) /* 0x40080000 .. 0x4008ffff : ARMSSE second Base peripheral region */ qdev_prop_set_uint32(DEVICE(&s->nswatchdog), "wdogclk-frq", s->mainclk_frq); - sysbus_realize(SYS_BUS_DEVICE(&s->nswatchdog), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->nswatchdog), &err)) { error_propagate(errp, err); return; } @@ -1063,8 +1040,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) sysbus_mmio_map(SYS_BUS_DEVICE(&s->nswatchdog), 0, 0x40081000); qdev_prop_set_uint32(DEVICE(&s->swatchdog), "wdogclk-frq", s->mainclk_frq); - sysbus_realize(SYS_BUS_DEVICE(&s->swatchdog), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->swatchdog), &err)) { error_propagate(errp, err); return; } @@ -1080,8 +1056,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } - qdev_realize(DEVICE(splitter), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(splitter), NULL, &err)) { error_propagate(errp, err); return; } @@ -1127,8 +1102,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } - qdev_realize(DEVICE(splitter), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(splitter), NULL, &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 3308211e9c..28baf330e5 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -213,15 +213,13 @@ static void armv7m_realize(DeviceState *dev, Error **errp) s->cpu->env.nvic = &s->nvic; s->nvic.cpu = s->cpu; - qdev_realize(DEVICE(s->cpu), NULL, &err); - if (err != NULL) { + if (!qdev_realize(DEVICE(s->cpu), NULL, &err)) { error_propagate(errp, err); return; } /* Note that we must realize the NVIC after the CPU */ - sysbus_realize(SYS_BUS_DEVICE(&s->nvic), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->nvic), &err)) { error_propagate(errp, err); return; } @@ -254,8 +252,7 @@ static void armv7m_realize(DeviceState *dev, Error **errp) } object_property_set_link(obj, OBJECT(s->board_memory), "source-memory", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(obj), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(obj), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index 59a7a1370b..b9ae4c12b4 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -259,8 +259,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) * is needed when using -kernel */ - qdev_realize(DEVICE(&s->cpu[i]), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, &err)) { error_propagate(errp, err); return; } @@ -301,16 +300,14 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) sc->memmap[ASPEED_SRAM], &s->sram); /* SCU */ - sysbus_realize(SYS_BUS_DEVICE(&s->scu), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->scu), &err)) { error_propagate(errp, err); return; } sysbus_mmio_map(SYS_BUS_DEVICE(&s->scu), 0, sc->memmap[ASPEED_SCU]); /* RTC */ - sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &err)) { error_propagate(errp, err); return; } @@ -321,8 +318,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) /* Timer */ object_property_set_link(OBJECT(&s->timerctrl), OBJECT(&s->scu), "scu", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->timerctrl), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->timerctrl), &err)) { error_propagate(errp, err); return; } @@ -343,8 +339,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) /* I2C */ object_property_set_link(OBJECT(&s->i2c), OBJECT(s->dram_mr), "dram", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->i2c), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c), &err)) { error_propagate(errp, err); return; } @@ -368,8 +363,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } - sysbus_realize(SYS_BUS_DEVICE(&s->fmc), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->fmc), &err)) { error_propagate(errp, err); return; } @@ -385,8 +379,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) "dram", &error_abort); object_property_set_int(OBJECT(&s->spi[i]), 1, "num-cs", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err)) { error_propagate(errp, err); return; } @@ -398,8 +391,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) /* EHCI */ for (i = 0; i < sc->ehcis_num; i++) { - sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), &err)) { error_propagate(errp, err); return; } @@ -410,8 +402,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) } /* SDMC - SDRAM Memory Controller */ - sysbus_realize(SYS_BUS_DEVICE(&s->sdmc), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdmc), &err)) { error_propagate(errp, err); return; } @@ -423,8 +414,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) object_property_set_link(OBJECT(&s->wdt[i]), OBJECT(&s->scu), "scu", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &err)) { error_propagate(errp, err); return; } @@ -436,8 +426,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) for (i = 0; i < sc->macs_num; i++) { object_property_set_bool(OBJECT(&s->ftgmac100[i]), true, "aspeed", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->ftgmac100[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->ftgmac100[i]), &err)) { error_propagate(errp, err); return; } @@ -448,8 +437,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) object_property_set_link(OBJECT(&s->mii[i]), OBJECT(&s->ftgmac100[i]), "nic", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->mii[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->mii[i]), &err)) { error_propagate(errp, err); return; } @@ -459,8 +447,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) } /* XDMA */ - sysbus_realize(SYS_BUS_DEVICE(&s->xdma), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->xdma), &err)) { error_propagate(errp, err); return; } @@ -470,8 +457,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) aspeed_soc_get_irq(s, ASPEED_XDMA)); /* GPIO */ - sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &err)) { error_propagate(errp, err); return; } @@ -479,8 +465,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio), 0, aspeed_soc_get_irq(s, ASPEED_GPIO)); - sysbus_realize(SYS_BUS_DEVICE(&s->gpio_1_8v), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio_1_8v), &err)) { error_propagate(errp, err); return; } @@ -490,8 +475,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) aspeed_soc_get_irq(s, ASPEED_GPIO_1_8V)); /* SDHCI */ - sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), &err)) { error_propagate(errp, err); return; } @@ -501,8 +485,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) aspeed_soc_get_irq(s, ASPEED_SDHCI)); /* eMMC */ - sysbus_realize(SYS_BUS_DEVICE(&s->emmc), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->emmc), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c index 311458aa76..fa56f96f92 100644 --- a/hw/arm/aspeed_soc.c +++ b/hw/arm/aspeed_soc.c @@ -230,8 +230,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) /* CPU */ for (i = 0; i < sc->num_cpus; i++) { - qdev_realize(DEVICE(&s->cpu[i]), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, &err)) { error_propagate(errp, err); return; } @@ -248,16 +247,14 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) sc->memmap[ASPEED_SRAM], &s->sram); /* SCU */ - sysbus_realize(SYS_BUS_DEVICE(&s->scu), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->scu), &err)) { error_propagate(errp, err); return; } sysbus_mmio_map(SYS_BUS_DEVICE(&s->scu), 0, sc->memmap[ASPEED_SCU]); /* VIC */ - sysbus_realize(SYS_BUS_DEVICE(&s->vic), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->vic), &err)) { error_propagate(errp, err); return; } @@ -268,8 +265,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ)); /* RTC */ - sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &err)) { error_propagate(errp, err); return; } @@ -280,8 +276,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) /* Timer */ object_property_set_link(OBJECT(&s->timerctrl), OBJECT(&s->scu), "scu", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->timerctrl), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->timerctrl), &err)) { error_propagate(errp, err); return; } @@ -302,8 +297,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) /* I2C */ object_property_set_link(OBJECT(&s->i2c), OBJECT(s->dram_mr), "dram", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->i2c), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c), &err)) { error_propagate(errp, err); return; } @@ -320,8 +314,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } - sysbus_realize(SYS_BUS_DEVICE(&s->fmc), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->fmc), &err)) { error_propagate(errp, err); return; } @@ -335,8 +328,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) for (i = 0; i < sc->spis_num; i++) { object_property_set_int(OBJECT(&s->spi[i]), 1, "num-cs", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err)) { error_propagate(errp, err); return; } @@ -348,8 +340,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) /* EHCI */ for (i = 0; i < sc->ehcis_num; i++) { - sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), &err)) { error_propagate(errp, err); return; } @@ -360,8 +351,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) } /* SDMC - SDRAM Memory Controller */ - sysbus_realize(SYS_BUS_DEVICE(&s->sdmc), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdmc), &err)) { error_propagate(errp, err); return; } @@ -373,8 +363,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) object_property_set_link(OBJECT(&s->wdt[i]), OBJECT(&s->scu), "scu", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &err)) { error_propagate(errp, err); return; } @@ -386,8 +375,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) for (i = 0; i < sc->macs_num; i++) { object_property_set_bool(OBJECT(&s->ftgmac100[i]), true, "aspeed", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->ftgmac100[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->ftgmac100[i]), &err)) { error_propagate(errp, err); return; } @@ -398,8 +386,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) } /* XDMA */ - sysbus_realize(SYS_BUS_DEVICE(&s->xdma), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->xdma), &err)) { error_propagate(errp, err); return; } @@ -409,8 +396,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) aspeed_soc_get_irq(s, ASPEED_XDMA)); /* GPIO */ - sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &err)) { error_propagate(errp, err); return; } @@ -419,8 +405,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) aspeed_soc_get_irq(s, ASPEED_GPIO)); /* SDHCI */ - sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index 7ffdf62067..2df81168e4 100644 --- a/hw/arm/bcm2835_peripherals.c +++ b/hw/arm/bcm2835_peripherals.c @@ -161,8 +161,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) } /* Interrupt Controller */ - sysbus_realize(SYS_BUS_DEVICE(&s->ic), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->ic), &err)) { error_propagate(errp, err); return; } @@ -172,8 +171,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) sysbus_pass_irq(SYS_BUS_DEVICE(s), SYS_BUS_DEVICE(&s->ic)); /* Sys Timer */ - sysbus_realize(SYS_BUS_DEVICE(&s->systmr), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->systmr), &err)) { error_propagate(errp, err); return; } @@ -185,8 +183,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) /* UART0 */ qdev_prop_set_chr(DEVICE(&s->uart0), "chardev", serial_hd(0)); - sysbus_realize(SYS_BUS_DEVICE(&s->uart0), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart0), &err)) { error_propagate(errp, err); return; } @@ -200,8 +197,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) /* AUX / UART1 */ qdev_prop_set_chr(DEVICE(&s->aux), "chardev", serial_hd(1)); - sysbus_realize(SYS_BUS_DEVICE(&s->aux), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->aux), &err)) { error_propagate(errp, err); return; } @@ -213,8 +209,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) INTERRUPT_AUX)); /* Mailboxes */ - sysbus_realize(SYS_BUS_DEVICE(&s->mboxes), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->mboxes), &err)) { error_propagate(errp, err); return; } @@ -239,8 +234,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) return; } - sysbus_realize(SYS_BUS_DEVICE(&s->fb), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->fb), &err)) { error_propagate(errp, err); return; } @@ -251,8 +245,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) qdev_get_gpio_in(DEVICE(&s->mboxes), MBOX_CHAN_FB)); /* Property channel */ - sysbus_realize(SYS_BUS_DEVICE(&s->property), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->property), &err)) { error_propagate(errp, err); return; } @@ -264,8 +257,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) qdev_get_gpio_in(DEVICE(&s->mboxes), MBOX_CHAN_PROPERTY)); /* Random Number Generator */ - sysbus_realize(SYS_BUS_DEVICE(&s->rng), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->rng), &err)) { error_propagate(errp, err); return; } @@ -289,8 +281,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) &error_abort); object_property_set_bool(OBJECT(&s->sdhci), true, "pending-insert-quirk", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), &err)) { error_propagate(errp, err); return; } @@ -302,8 +293,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) INTERRUPT_ARASANSDIO)); /* SDHOST */ - sysbus_realize(SYS_BUS_DEVICE(&s->sdhost), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdhost), &err)) { error_propagate(errp, err); return; } @@ -315,8 +305,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) INTERRUPT_SDIO)); /* DMA Channels */ - sysbus_realize(SYS_BUS_DEVICE(&s->dma), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->dma), &err)) { error_propagate(errp, err); return; } @@ -334,8 +323,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) } /* THERMAL */ - sysbus_realize(SYS_BUS_DEVICE(&s->thermal), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->thermal), &err)) { error_propagate(errp, err); return; } @@ -343,8 +331,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->thermal), 0)); /* GPIO */ - sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &err)) { error_propagate(errp, err); return; } @@ -355,8 +342,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->gpio), "sd-bus"); /* Mphi */ - sysbus_realize(SYS_BUS_DEVICE(&s->mphi), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->mphi), &err)) { error_propagate(errp, err); return; } @@ -368,8 +354,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) INTERRUPT_HOSTPORT)); /* DWC2 */ - sysbus_realize(SYS_BUS_DEVICE(&s->dwc2), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->dwc2), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index ed1793f7b7..1a7560ef30 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -86,8 +86,7 @@ static void bcm2836_realize(DeviceState *dev, Error **errp) object_property_add_const_link(OBJECT(&s->peripherals), "ram", obj); - sysbus_realize(SYS_BUS_DEVICE(&s->peripherals), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->peripherals), &err)) { error_propagate(errp, err); return; } @@ -99,8 +98,7 @@ static void bcm2836_realize(DeviceState *dev, Error **errp) info->peri_base, 1); /* bcm2836 interrupt controller (and mailboxes, etc.) */ - sysbus_realize(SYS_BUS_DEVICE(&s->control), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->control), &err)) { error_propagate(errp, err); return; } @@ -133,8 +131,7 @@ static void bcm2836_realize(DeviceState *dev, Error **errp) return; } - qdev_realize(DEVICE(&s->cpu[n].core), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->cpu[n].core), NULL, &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c index 5cbd115c53..c720e24ced 100644 --- a/hw/arm/cubieboard.c +++ b/hw/arm/cubieboard.c @@ -80,8 +80,7 @@ static void cubieboard_init(MachineState *machine) exit(1); } - qdev_realize(DEVICE(a10), NULL, &err); - if (err != NULL) { + if (!qdev_realize(DEVICE(a10), NULL, &err)) { error_reportf_err(err, "Couldn't realize Allwinner A10: "); exit(1); } diff --git a/hw/arm/digic.c b/hw/arm/digic.c index 13a83f7430..1494c2900a 100644 --- a/hw/arm/digic.c +++ b/hw/arm/digic.c @@ -62,15 +62,13 @@ static void digic_realize(DeviceState *dev, Error **errp) return; } - qdev_realize(DEVICE(&s->cpu), NULL, &err); - if (err != NULL) { + if (!qdev_realize(DEVICE(&s->cpu), NULL, &err)) { error_propagate(errp, err); return; } for (i = 0; i < DIGIC4_NB_TIMERS; i++) { - sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), &err)) { error_propagate(errp, err); return; } @@ -80,8 +78,7 @@ static void digic_realize(DeviceState *dev, Error **errp) } qdev_prop_set_chr(DEVICE(&s->uart), "chardev", serial_hd(0)); - sysbus_realize(SYS_BUS_DEVICE(&s->uart), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c index b6452d918c..d5524d3e72 100644 --- a/hw/arm/digic_boards.c +++ b/hw/arm/digic_boards.c @@ -62,8 +62,7 @@ static void digic4_board_init(MachineState *machine, DigicBoard *board) exit(EXIT_FAILURE); } - qdev_realize(DEVICE(s), NULL, &err); - if (err != NULL) { + if (!qdev_realize(DEVICE(s), NULL, &err)) { error_reportf_err(err, "Couldn't realize DIGIC SoC: "); exit(1); } diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c index 7ab5c98fbe..250681f045 100644 --- a/hw/arm/fsl-imx25.c +++ b/hw/arm/fsl-imx25.c @@ -85,14 +85,12 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) uint8_t i; Error *err = NULL; - qdev_realize(DEVICE(&s->cpu), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->cpu), NULL, &err)) { error_propagate(errp, err); return; } - sysbus_realize(SYS_BUS_DEVICE(&s->avic), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->avic), &err)) { error_propagate(errp, err); return; } @@ -102,8 +100,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->avic), 1, qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ)); - sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &err)) { error_propagate(errp, err); return; } @@ -124,8 +121,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i)); - sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err)) { error_propagate(errp, err); return; } @@ -149,8 +145,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) s->gpt[i].ccm = IMX_CCM(&s->ccm); - sysbus_realize(SYS_BUS_DEVICE(&s->gpt[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpt[i]), &err)) { error_propagate(errp, err); return; } @@ -172,8 +167,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) s->epit[i].ccm = IMX_CCM(&s->ccm); - sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), &err)) { error_propagate(errp, err); return; } @@ -185,8 +179,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) qdev_set_nic_properties(DEVICE(&s->fec), &nd_table[0]); - sysbus_realize(SYS_BUS_DEVICE(&s->fec), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->fec), &err)) { error_propagate(errp, err); return; } @@ -194,8 +187,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->fec), 0, qdev_get_gpio_in(DEVICE(&s->avic), FSL_IMX25_FEC_IRQ)); - sysbus_realize(SYS_BUS_DEVICE(&s->rngc), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->rngc), &err)) { error_propagate(errp, err); return; } @@ -214,8 +206,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) { FSL_IMX25_I2C3_ADDR, FSL_IMX25_I2C3_IRQ } }; - sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), &err)) { error_propagate(errp, err); return; } @@ -237,8 +228,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) { FSL_IMX25_GPIO4_ADDR, FSL_IMX25_GPIO4_IRQ } }; - sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), &err)) { error_propagate(errp, err); return; } @@ -267,8 +257,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) object_property_set_uint(OBJECT(&s->esdhc[i]), SDHCI_VENDOR_IMX, "vendor", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c index 42cca529c3..4f007ea5e8 100644 --- a/hw/arm/fsl-imx31.c +++ b/hw/arm/fsl-imx31.c @@ -66,14 +66,12 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp) uint16_t i; Error *err = NULL; - qdev_realize(DEVICE(&s->cpu), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->cpu), NULL, &err)) { error_propagate(errp, err); return; } - sysbus_realize(SYS_BUS_DEVICE(&s->avic), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->avic), &err)) { error_propagate(errp, err); return; } @@ -83,8 +81,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->avic), 1, qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ)); - sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &err)) { error_propagate(errp, err); return; } @@ -102,8 +99,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp) qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i)); - sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err)) { error_propagate(errp, err); return; } @@ -116,8 +112,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp) s->gpt.ccm = IMX_CCM(&s->ccm); - sysbus_realize(SYS_BUS_DEVICE(&s->gpt), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpt), &err)) { error_propagate(errp, err); return; } @@ -138,8 +133,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp) s->epit[i].ccm = IMX_CCM(&s->ccm); - sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), &err)) { error_propagate(errp, err); return; } @@ -162,8 +156,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp) }; /* Initialize the I2C */ - sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), &err)) { error_propagate(errp, err); return; } @@ -188,8 +181,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp) object_property_set_bool(OBJECT(&s->gpio[i]), false, "has-edge-sel", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index 4ae3c3efc2..417ca6889c 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -130,8 +130,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) "start-powered-off", &error_abort); } - qdev_realize(DEVICE(&s->cpu[i]), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, &err)) { error_propagate(errp, err); return; } @@ -144,8 +143,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) FSL_IMX6_MAX_IRQ + GIC_INTERNAL, "num-irq", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->a9mpcore), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->a9mpcore), &err)) { error_propagate(errp, err); return; } @@ -158,15 +156,13 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) qdev_get_gpio_in(DEVICE(&s->cpu[i]), ARM_CPU_FIQ)); } - sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &err)) { error_propagate(errp, err); return; } sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, FSL_IMX6_CCM_ADDR); - sysbus_realize(SYS_BUS_DEVICE(&s->src), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->src), &err)) { error_propagate(errp, err); return; } @@ -187,8 +183,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i)); - sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err)) { error_propagate(errp, err); return; } @@ -201,8 +196,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) s->gpt.ccm = IMX_CCM(&s->ccm); - sysbus_realize(SYS_BUS_DEVICE(&s->gpt), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpt), &err)) { error_propagate(errp, err); return; } @@ -224,8 +218,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) s->epit[i].ccm = IMX_CCM(&s->ccm); - sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), &err)) { error_propagate(errp, err); return; } @@ -247,8 +240,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) { FSL_IMX6_I2C3_ADDR, FSL_IMX6_I2C3_IRQ } }; - sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), &err)) { error_propagate(errp, err); return; } @@ -307,8 +299,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) &error_abort); object_property_set_bool(OBJECT(&s->gpio[i]), true, "has-upper-pin-irq", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), &err)) { error_propagate(errp, err); return; } @@ -343,8 +334,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) object_property_set_uint(OBJECT(&s->esdhc[i]), SDHCI_VENDOR_IMX, "vendor", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), &err)) { error_propagate(errp, err); return; } @@ -390,8 +380,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) }; /* Initialize the SPI */ - sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err)) { error_propagate(errp, err); return; } @@ -403,8 +392,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) } qdev_set_nic_properties(DEVICE(&s->eth), &nd_table[0]); - sysbus_realize(SYS_BUS_DEVICE(&s->eth), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->eth), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c index 3235c76194..476112b2d9 100644 --- a/hw/arm/msf2-soc.c +++ b/hw/arm/msf2-soc.c @@ -125,8 +125,7 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp) 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) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), &err)) { error_propagate(errp, err); return; } @@ -153,8 +152,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) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer), &err)) { error_propagate(errp, err); return; } @@ -168,8 +166,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) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->sysreg), &err)) { error_propagate(errp, err); return; } @@ -179,8 +176,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) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err)) { error_propagate(errp, err); return; } @@ -199,8 +195,7 @@ 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) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->emac), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c index 20dd8b5897..e9c77e4c21 100644 --- a/hw/arm/nrf51_soc.c +++ b/hw/arm/nrf51_soc.c @@ -67,8 +67,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp) object_property_set_link(OBJECT(&s->cpu), OBJECT(&s->container), "memory", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->cpu), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpu), &err)) { error_propagate(errp, err); return; } @@ -84,8 +83,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp) memory_region_add_subregion(&s->container, NRF51_SRAM_BASE, &s->sram); /* UART */ - sysbus_realize(SYS_BUS_DEVICE(&s->uart), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart), &err)) { error_propagate(errp, err); return; } @@ -96,8 +94,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp) BASE_TO_IRQ(NRF51_UART_BASE))); /* RNG */ - sysbus_realize(SYS_BUS_DEVICE(&s->rng), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->rng), &err)) { error_propagate(errp, err); return; } @@ -116,8 +113,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp) return; } - sysbus_realize(SYS_BUS_DEVICE(&s->nvm), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->nvm), &err)) { error_propagate(errp, err); return; } @@ -132,8 +128,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp) memory_region_add_subregion_overlap(&s->container, NRF51_FLASH_BASE, mr, 0); /* GPIO */ - sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &err)) { error_propagate(errp, err); return; } @@ -151,8 +146,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp) error_propagate(errp, err); return; } - sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c index 56aef686c9..46b5332470 100644 --- a/hw/arm/stm32f205_soc.c +++ b/hw/arm/stm32f205_soc.c @@ -107,16 +107,14 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp) 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) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), &err)) { error_propagate(errp, err); return; } /* System configuration controller */ dev = DEVICE(&s->syscfg); - sysbus_realize(SYS_BUS_DEVICE(&s->syscfg), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->syscfg), &err)) { error_propagate(errp, err); return; } @@ -128,8 +126,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp) for (i = 0; i < STM_NUM_USARTS; i++) { dev = DEVICE(&(s->usart[i])); qdev_prop_set_chr(dev, "chardev", serial_hd(i)); - sysbus_realize(SYS_BUS_DEVICE(&s->usart[i]), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->usart[i]), &err)) { error_propagate(errp, err); return; } @@ -142,8 +139,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp) for (i = 0; i < STM_NUM_TIMERS; i++) { dev = DEVICE(&(s->timer[i])); qdev_prop_set_uint64(dev, "clock-frequency", 1000000000); - sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), &err)) { error_propagate(errp, err); return; } @@ -155,8 +151,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp) /* ADC 1 to 3 */ object_property_set_int(OBJECT(s->adc_irqs), STM_NUM_ADCS, "num-lines", &error_abort); - qdev_realize(DEVICE(s->adc_irqs), NULL, &err); - if (err != NULL) { + if (!qdev_realize(DEVICE(s->adc_irqs), NULL, &err)) { error_propagate(errp, err); return; } @@ -165,8 +160,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp) for (i = 0; i < STM_NUM_ADCS; i++) { dev = DEVICE(&(s->adc[i])); - sysbus_realize(SYS_BUS_DEVICE(&s->adc[i]), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->adc[i]), &err)) { error_propagate(errp, err); return; } @@ -179,8 +173,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp) /* SPI 1 and 2 */ for (i = 0; i < STM_NUM_SPIS; i++) { dev = DEVICE(&(s->spi[i])); - sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/stm32f405_soc.c b/hw/arm/stm32f405_soc.c index cf9228d8e7..f1f0dc40b1 100644 --- a/hw/arm/stm32f405_soc.c +++ b/hw/arm/stm32f405_soc.c @@ -118,16 +118,14 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp) qdev_prop_set_bit(armv7m, "enable-bitband", true); object_property_set_link(OBJECT(&s->armv7m), OBJECT(system_memory), "memory", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), &err)) { error_propagate(errp, err); return; } /* System configuration controller */ dev = DEVICE(&s->syscfg); - sysbus_realize(SYS_BUS_DEVICE(&s->syscfg), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->syscfg), &err)) { error_propagate(errp, err); return; } @@ -139,8 +137,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp) for (i = 0; i < STM_NUM_USARTS; i++) { dev = DEVICE(&(s->usart[i])); qdev_prop_set_chr(dev, "chardev", serial_hd(i)); - sysbus_realize(SYS_BUS_DEVICE(&s->usart[i]), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->usart[i]), &err)) { error_propagate(errp, err); return; } @@ -153,8 +150,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp) for (i = 0; i < STM_NUM_TIMERS; i++) { dev = DEVICE(&(s->timer[i])); qdev_prop_set_uint64(dev, "clock-frequency", 1000000000); - sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer[i]), &err)) { error_propagate(errp, err); return; } @@ -173,8 +169,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp) } object_property_set_int(OBJECT(&s->adc_irqs), STM_NUM_ADCS, "num-lines", &error_abort); - qdev_realize(DEVICE(&s->adc_irqs), NULL, &err); - if (err != NULL) { + if (!qdev_realize(DEVICE(&s->adc_irqs), NULL, &err)) { error_propagate(errp, err); return; } @@ -183,8 +178,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp) for (i = 0; i < STM_NUM_ADCS; i++) { dev = DEVICE(&(s->adc[i])); - sysbus_realize(SYS_BUS_DEVICE(&s->adc[i]), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->adc[i]), &err)) { error_propagate(errp, err); return; } @@ -197,8 +191,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp) /* SPI devices */ for (i = 0; i < STM_NUM_SPIS; i++) { dev = DEVICE(&(s->spi[i])); - sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err)) { error_propagate(errp, err); return; } @@ -209,8 +202,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp) /* EXTI device */ dev = DEVICE(&s->exti); - sysbus_realize(SYS_BUS_DEVICE(&s->exti), &err); - if (err != NULL) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->exti), &err)) { error_propagate(errp, err); return; } diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 1de9d4a89d..d703158f8b 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -209,8 +209,7 @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s, object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "reset-hivecs", &error_abort); - qdev_realize(DEVICE(&s->rpu_cpu[i]), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->rpu_cpu[i]), NULL, &err)) { error_propagate(errp, err); return; } @@ -367,15 +366,13 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) "reset-cbar", &error_abort); object_property_set_int(OBJECT(&s->apu_cpu[i]), num_apus, "core-count", &error_abort); - qdev_realize(DEVICE(&s->apu_cpu[i]), NULL, &err); - if (err) { + if (!qdev_realize(DEVICE(&s->apu_cpu[i]), NULL, &err)) { error_propagate(errp, err); return; } } - sysbus_realize(SYS_BUS_DEVICE(&s->gic), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), &err)) { error_propagate(errp, err); return; } @@ -470,8 +467,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) &error_abort); object_property_set_int(OBJECT(&s->gem[i]), 2, "num-priority-queues", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->gem[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gem[i]), &err)) { error_propagate(errp, err); return; } @@ -482,8 +478,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) for (i = 0; i < XLNX_ZYNQMP_NUM_UARTS; i++) { qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i)); - sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err)) { error_propagate(errp, err); return; } @@ -494,8 +489,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) object_property_set_int(OBJECT(&s->sata), SATA_NUM_PORTS, "num-ports", &error_abort); - sysbus_realize(SYS_BUS_DEVICE(&s->sata), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->sata), &err)) { error_propagate(errp, err); return; } @@ -528,8 +522,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } - sysbus_realize(SYS_BUS_DEVICE(sdhci), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(sdhci), &err)) { error_propagate(errp, err); return; } @@ -545,8 +538,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) for (i = 0; i < XLNX_ZYNQMP_NUM_SPIS; i++) { gchar *bus_name; - sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err)) { error_propagate(errp, err); return; } @@ -562,8 +554,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) g_free(bus_name); } - sysbus_realize(SYS_BUS_DEVICE(&s->qspi), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->qspi), &err)) { error_propagate(errp, err); return; } @@ -584,16 +575,14 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) g_free(target_bus); } - sysbus_realize(SYS_BUS_DEVICE(&s->dp), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->dp), &err)) { error_propagate(errp, err); return; } sysbus_mmio_map(SYS_BUS_DEVICE(&s->dp), 0, DP_ADDR); sysbus_connect_irq(SYS_BUS_DEVICE(&s->dp), 0, gic_spi[DP_IRQ]); - sysbus_realize(SYS_BUS_DEVICE(&s->dpdma), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->dpdma), &err)) { error_propagate(errp, err); return; } @@ -602,16 +591,14 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) sysbus_mmio_map(SYS_BUS_DEVICE(&s->dpdma), 0, DPDMA_ADDR); sysbus_connect_irq(SYS_BUS_DEVICE(&s->dpdma), 0, gic_spi[DPDMA_IRQ]); - sysbus_realize(SYS_BUS_DEVICE(&s->ipi), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->ipi), &err)) { error_propagate(errp, err); return; } sysbus_mmio_map(SYS_BUS_DEVICE(&s->ipi), 0, IPI_ADDR); sysbus_connect_irq(SYS_BUS_DEVICE(&s->ipi), 0, gic_spi[IPI_IRQ]); - sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &err)) { error_propagate(errp, err); return; } @@ -624,8 +611,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } - sysbus_realize(SYS_BUS_DEVICE(&s->gdma[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gdma[i]), &err)) { error_propagate(errp, err); return; } @@ -636,8 +622,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) } for (i = 0; i < XLNX_ZYNQMP_NUM_ADMA_CH; i++) { - sysbus_realize(SYS_BUS_DEVICE(&s->adma[i]), &err); - if (err) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->adma[i]), &err)) { error_propagate(errp, err); return; } |