diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-10-20 15:03:22 +0200 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2023-10-27 12:48:57 +0100 |
commit | 85500a1aef1cdfb2878d88a3d88db56ad972fb60 (patch) | |
tree | 746806705f298dc3bb811d22d46662194649e266 | |
parent | f3205af4c7f29ba4fc0f995d48e450787f93853e (diff) | |
download | qemu-85500a1aef1cdfb2878d88a3d88db56ad972fb60.zip qemu-85500a1aef1cdfb2878d88a3d88db56ad972fb60.tar.gz qemu-85500a1aef1cdfb2878d88a3d88db56ad972fb60.tar.bz2 |
hw/sd/pxa2xx: Realize sysbus device before accessing it
sysbus_mmio_map() and sysbus_connect_irq() should not be
called on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20231020130331.50048-2-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | hw/sd/pxa2xx_mmci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 124fbf8..9f7a880 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -483,11 +483,11 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, dev = qdev_new(TYPE_PXA2XX_MMCI); sbd = SYS_BUS_DEVICE(dev); + sysbus_realize_and_unref(sbd, &error_fatal); sysbus_mmio_map(sbd, 0, base); sysbus_connect_irq(sbd, 0, irq); qdev_connect_gpio_out_named(dev, "rx-dma", 0, rx_dma); qdev_connect_gpio_out_named(dev, "tx-dma", 0, tx_dma); - sysbus_realize_and_unref(sbd, &error_fatal); return PXA2XX_MMCI(dev); } |