[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-5.1 v2 10/54] hw/arm/fsl-imx31: Move some code from realize()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-5.1 v2 10/54] hw/arm/fsl-imx31: Move some code from realize() to init() |
Date: |
Mon, 6 Apr 2020 19:46:59 +0200 |
Coccinelle reported:
$ spatch ... --timeout 60 --sp-file \
scripts/coccinelle/simplify-init-realize-error_propagate.cocci
HANDLING: hw/arm/fsl-imx31.c
>>> possible moves from fsl_imx31_init() to fsl_imx31_realize() in
hw/arm/fsl-imx31.c:68
Move the calls using &error_abort which don't depend of input
updated before realize() to init().
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/arm/fsl-imx31.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c
index 8472d2e911..61287e24f6 100644
--- a/hw/arm/fsl-imx31.c
+++ b/hw/arm/fsl-imx31.c
@@ -62,6 +62,8 @@ static void fsl_imx31_init(Object *obj)
for (i = 0; i < FSL_IMX31_NUM_GPIOS; i++) {
sysbus_init_child_obj(obj, "gpio[*]", &s->gpio[i], sizeof(s->gpio[i]),
TYPE_IMX_GPIO);
+ object_property_set_bool(OBJECT(&s->gpio[i]), false, "has-edge-sel",
+ &error_abort);
}
}
@@ -191,8 +193,6 @@ static void fsl_imx31_realize(DeviceState *dev, Error
**errp)
{ FSL_IMX31_GPIO3_ADDR, FSL_IMX31_GPIO3_IRQ }
};
- object_property_set_bool(OBJECT(&s->gpio[i]), false, "has-edge-sel",
- &error_abort);
object_property_set_bool(OBJECT(&s->gpio[i]), true, "realized", &err);
if (err) {
error_propagate(errp, err);
--
2.21.1
- Re: [PATCH-for-5.1 v2 03/54] hw/arm/allwinner-a10: Move some code from realize() to init(), (continued)
- [PATCH-for-5.1 v2 04/54] hw/arm/aspeed_ast2600: Simplify use of Error*, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 01/54] various: Remove suspicious '\' character outside of #define in C code, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 05/54] hw/arm/aspeed_ast2600: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 07/54] hw/arm/aspeed_soc: Simplify use of Error*, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 09/54] hw/arm/fsl-imx6: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 08/54] hw/arm/fsl-imx6: Simplify checks on 'smp_cpus' count, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 10/54] hw/arm/fsl-imx31: Move some code from realize() to init(),
Philippe Mathieu-Daudé <=
- [PATCH-for-5.1 v2 13/54] hw/arm/stm32f205_soc: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 11/54] hw/arm/msf2-soc: Store MemoryRegion in MSF2State, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 06/54] hw/arm/aspeed_soc: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 15/54] hw/arm/xlnx-zynqmp: Split xlnx_zynqmp_create_rpu() as init + realize, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 14/54] hw/arm/xlnx-zynqmp: Use single propagate_error() call, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 18/54] hw/pci-host/pnv_phb3: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 19/54] hw/riscv/sifive_e: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 20/54] hw/riscv/sifive_u: Use single type_init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 16/54] hw/arm/xlnx-zynqmp: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06