qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH 10/18] hw/net/ne2000-pci.c: switch NE2000State to use PCI dev


From: Mark Cave-Ayland
Subject: [RFC PATCH 10/18] hw/net/ne2000-pci.c: switch NE2000State to use PCI device input gpio
Date: Thu, 11 May 2023 09:57:23 +0100

This replaces the call to pci_allocate_irq() and also allows the corresponding
qemu_free_irq() to be removed.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/net/ne2000-pci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/net/ne2000-pci.c b/hw/net/ne2000-pci.c
index edc6689d33..27bdb3e11b 100644
--- a/hw/net/ne2000-pci.c
+++ b/hw/net/ne2000-pci.c
@@ -64,7 +64,7 @@ static void pci_ne2000_realize(PCIDevice *pci_dev, Error 
**errp)
     s = &d->ne2000;
     ne2000_setup_io(s, DEVICE(pci_dev), 0x100);
     pci_register_bar(&d->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io);
-    s->irq = pci_allocate_irq(&d->dev);
+    s->irq = qdev_get_gpio_in_named(DEVICE(pci_dev), "pci-input-irq", 0);
 
     qemu_macaddr_default_if_unset(&s->c.macaddr);
     ne2000_reset(s);
@@ -81,7 +81,6 @@ static void pci_ne2000_exit(PCIDevice *pci_dev)
     NE2000State *s = &d->ne2000;
 
     qemu_del_nic(s->nic);
-    qemu_free_irq(s->irq);
 }
 
 static void ne2000_instance_init(Object *obj)
-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]