[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 06/11] hw/misc/macio: Realize IDE controller before accessing
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 06/11] hw/misc/macio: Realize IDE controller before accessing it |
Date: |
Thu, 8 Feb 2024 19:12:39 +0100 |
We should not wire IRQs on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/misc/macio/macio.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index c9f22f8515..db662a2065 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -122,15 +122,17 @@ static bool macio_realize_ide(MacIOState *s,
MACIOIDEState *ide,
Error **errp)
{
SysBusDevice *sbd = SYS_BUS_DEVICE(ide);
+ bool success;
- sysbus_connect_irq(sbd, 0, irq0);
- sysbus_connect_irq(sbd, 1, irq1);
qdev_prop_set_uint32(DEVICE(ide), "channel", dmaid);
object_property_set_link(OBJECT(ide), "dbdma", OBJECT(&s->dbdma),
&error_abort);
macio_ide_register_dma(ide);
+ success = qdev_realize(DEVICE(ide), BUS(&s->macio_bus), errp);
+ sysbus_connect_irq(sbd, 0, irq0);
+ sysbus_connect_irq(sbd, 1, irq1);
- return qdev_realize(DEVICE(ide), BUS(&s->macio_bus), errp);
+ return success;
}
static void macio_oldworld_realize(PCIDevice *d, Error **errp)
--
2.41.0
- Re: [PATCH v3 03/11] hw/rx/rx62n: Only call qdev_get_gpio_in() when necessary, (continued)
- [PATCH v3 04/11] hw/i386/pc_q35: Realize LPC PCI function before accessing it, Philippe Mathieu-Daudé, 2024/02/08
- [PATCH v3 02/11] hw/rx/rx62n: Reduce inclusion of 'qemu/units.h', Philippe Mathieu-Daudé, 2024/02/08
- [PATCH v3 05/11] hw/ppc/prep: Realize ISA bridge before accessing it, Philippe Mathieu-Daudé, 2024/02/08
- [PATCH v3 06/11] hw/misc/macio: Realize IDE controller before accessing it,
Philippe Mathieu-Daudé <=
- [PATCH v3 08/11] hw/sparc/sun4m: Realize DMA controller before accessing it, Philippe Mathieu-Daudé, 2024/02/08
- [PATCH v3 07/11] hw/sh4/r2d: Realize IDE controller before accessing it, Philippe Mathieu-Daudé, 2024/02/08