From d50280af1bc4b9a59c4a6424c6172a1397f5f6c3 Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Tue, 21 Jan 2025 08:34:55 +0100 Subject: hw/ipack: Remove legacy qemu_allocate_irqs() use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No need to dynamically allocate IRQ when we know before hands how many we'll use. Declare the 2 of them in IPackDevice state and initialize them in the DeviceRealize handler. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250121155526.29982-4-philmd@linaro.org> --- hw/ipack/ipack.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'hw/ipack/ipack.c') diff --git a/hw/ipack/ipack.c b/hw/ipack/ipack.c index ed75f79183..b6defae602 100644 --- a/hw/ipack/ipack.c +++ b/hw/ipack/ipack.c @@ -55,22 +55,19 @@ static void ipack_device_realize(DeviceState *dev, Error **errp) } bus->free_slot = idev->slot + 1; - idev->irq = qemu_allocate_irqs(bus->set_irq, idev, 2); + qemu_init_irqs(idev->irq, ARRAY_SIZE(idev->irq), bus->set_irq, idev); k->realize(dev, errp); } static void ipack_device_unrealize(DeviceState *dev) { - IPackDevice *idev = IPACK_DEVICE(dev); IPackDeviceClass *k = IPACK_DEVICE_GET_CLASS(dev); if (k->unrealize) { k->unrealize(dev); return; } - - qemu_free_irqs(idev->irq, 2); } static const Property ipack_device_props[] = { -- cgit 1.4.1