[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 06/12] hw/misc/macio: Realize IDE controller before accessing
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v4 06/12] hw/misc/macio: Realize IDE controller before accessing it |
Date: |
Tue, 13 Feb 2024 14:03:35 +0100 |
We should not wire IRQs on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/misc/macio/macio.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index c9f22f8515..3f449f91c0 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -123,14 +123,17 @@ static bool macio_realize_ide(MacIOState *s,
MACIOIDEState *ide,
{
SysBusDevice *sbd = SYS_BUS_DEVICE(ide);
- 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);
+ if (!qdev_realize(DEVICE(ide), BUS(&s->macio_bus), errp)) {
+ return false;
+ }
+ sysbus_connect_irq(sbd, 0, irq0);
+ sysbus_connect_irq(sbd, 1, irq1);
- return qdev_realize(DEVICE(ide), BUS(&s->macio_bus), errp);
+ return true;
}
static void macio_oldworld_realize(PCIDevice *d, Error **errp)
--
2.41.0
- [PATCH v4 00/12] hw: Strengthen SysBus & QBus API, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 02/12] hw/rx/rx62n: Reduce inclusion of 'qemu/units.h', Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 01/12] hw/ide/ich9: Use AHCIPCIState typedef, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 03/12] hw/rx/rx62n: Only call qdev_get_gpio_in() when necessary, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 04/12] hw/i386/q35: Realize LPC PCI function before accessing it, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 05/12] hw/ppc/prep: Realize ISA bridge before accessing it, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 06/12] hw/misc/macio: Realize IDE controller before accessing it,
Philippe Mathieu-Daudé <=
- [PATCH v4 07/12] hw/sh4/r2d: Realize IDE controller before accessing it, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 12/12] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 09/12] hw/sparc/leon3: Realize GRLIB IRQ controller before accessing it, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 10/12] hw/sparc/leon3: Pass DeviceState opaque argument to leon3_set_pil_in(), Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 11/12] hw/sparc/leon3: Initialize GPIO before realizing CPU devices, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 08/12] hw/sparc/sun4m: Realize DMA controller before accessing it, Philippe Mathieu-Daudé, 2024/02/13