[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-5.1 v3 05/23] hw/arm/allwinner-a10: Add missing error-propaga
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-5.1 v3 05/23] hw/arm/allwinner-a10: Add missing error-propagation code |
Date: |
Mon, 13 Apr 2020 00:41:26 +0200 |
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é <address@hidden>
---
hw/arm/allwinner-a10.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c
index f41395734a..db70aa2b88 100644
--- a/hw/arm/allwinner-a10.c
+++ b/hw/arm/allwinner-a10.c
@@ -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));
--
2.21.1
- [PATCH-for-5.1 v3 00/23] various: Fix error-propagation with Coccinelle scripts (part 2), Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 01/23] scripts/coccinelle: Catch missing error_propagate() calls in realize(), Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 02/23] hw/arm/fsl-imx: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 03/23] hw/arm/stm32f*05_soc: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 05/23] hw/arm/allwinner-a10: Add missing error-propagation code,
Philippe Mathieu-Daudé <=
- [PATCH-for-5.1 v3 04/23] hw/arm/aspeed: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 06/23] hw/arm/msf2-soc: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 07/23] hw/riscv/sifive: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 08/23] hw/arm/armv7m: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 09/23] hw/intc/arm_gicv3_its_kvm: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 11/23] hw/pci-host/pnv_phb3: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12