diff mbox series

[30/50] lasi: use qdev GPIOs to wire up IRQs in lasi_initfn()

Message ID 20220421193100.5098-31-mark.cave-ayland@ilande.co.uk (mailing list archive)
State New, archived
Headers show
Series hppa: general improvements and tidy-ups | expand

Commit Message

Mark Cave-Ayland April 21, 2022, 7:30 p.m. UTC
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/hppa/lasi.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c
index 9489a80bad..32c7514d3a 100644
--- a/hw/hppa/lasi.c
+++ b/hw/hppa/lasi.c
@@ -234,38 +234,31 @@  static void lasi_set_irq(void *opaque, int irq, int level)
 DeviceState *lasi_initfn(MemoryRegion *address_space)
 {
     DeviceState *dev;
-    LasiState *s;
 
     dev = qdev_new(TYPE_LASI_CHIP);
-    s = LASI_CHIP(dev);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
 
     /* LAN */
     if (enable_lasi_lan()) {
-        qemu_irq lan_irq = qemu_allocate_irq(lasi_set_irq, s,
-                                             LASI_IRQ_LAN_HPA);
-        lasi_82596_init(address_space, LASI_LAN_HPA, lan_irq);
+        lasi_82596_init(address_space, LASI_LAN_HPA,
+                        qdev_get_gpio_in(dev, LASI_IRQ_LAN_HPA));
     }
 
     /* Parallel port */
-    qemu_irq lpt_irq = qemu_allocate_irq(lasi_set_irq, s,
-                                         LASI_IRQ_LPT_HPA);
     parallel_mm_init(address_space, LASI_LPT_HPA + 0x800, 0,
-                     lpt_irq, parallel_hds[0]);
+                     qdev_get_gpio_in(dev, LASI_IRQ_LAN_HPA),
+                     parallel_hds[0]);
 
     if (serial_hd(1)) {
         /* Serial port */
-        qemu_irq serial_irq = qemu_allocate_irq(lasi_set_irq, s,
-                                                LASI_IRQ_UART_HPA);
         serial_mm_init(address_space, LASI_UART_HPA + 0x800, 0,
-                serial_irq, 8000000 / 16,
+                qdev_get_gpio_in(dev, LASI_IRQ_UART_HPA), 8000000 / 16,
                 serial_hd(0), DEVICE_NATIVE_ENDIAN);
     }
 
     /* PS/2 Keyboard/Mouse */
-    qemu_irq ps2kbd_irq = qemu_allocate_irq(lasi_set_irq, s,
-                                            LASI_IRQ_PS2KBD_HPA);
-    lasips2_init(address_space, LASI_PS2KBD_HPA,  ps2kbd_irq);
+    lasips2_init(address_space, LASI_PS2KBD_HPA,
+                 qdev_get_gpio_in(dev, LASI_IRQ_PS2KBD_HPA));
 
     return dev;
 }