diff options
Diffstat (limited to 'hw/arm/aspeed_ast2600.c')
-rw-r--r-- | hw/arm/aspeed_ast2600.c | 51 |
1 files changed, 17 insertions, 34 deletions
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; } |