This replaces the call to pci_allocate_irq() and also allows the corresponding
qemu_free_irq() to be removed. Since esp_pci_scsi_exit() is now empty it can 
also
be removed at the same time.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk>
---
 hw/scsi/esp-pci.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
index 2f7f11e70b..9447e6c429 100644
--- a/hw/scsi/esp-pci.c
+++ b/hw/scsi/esp-pci.c
@@ -386,19 +386,11 @@ static void esp_pci_scsi_realize(PCIDevice *dev, Error 
**errp)
                           "esp-io", 0x80);
 
     pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &pci->io);
-    s->irq = pci_allocate_irq(dev);
+    s->irq = qdev_get_gpio_in_named(DEVICE(dev), "pci-input-irq", 0);
 
     scsi_bus_init(&s->bus, sizeof(s->bus), d, &esp_pci_scsi_info);
 }
 
-static void esp_pci_scsi_exit(PCIDevice *d)
-{
-    PCIESPState *pci = PCI_ESP(d);
-    ESPState *s = ESP(&pci->esp);
-
-    qemu_free_irq(s->irq);
-}
-
 static void esp_pci_init(Object *obj)
 {
     PCIESPState *pci = PCI_ESP(obj);
@@ -412,7 +404,6 @@ static void esp_pci_class_init(ObjectClass *klass, void 
*data)
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
 
     k->realize = esp_pci_scsi_realize;
-    k->exit = esp_pci_scsi_exit;
     k->vendor_id = PCI_VENDOR_ID_AMD;
     k->device_id = PCI_DEVICE_ID_AMD_SCSI;
     k->revision = 0x10;
-- 
2.30.2


Reply via email to