diff mbox series

[3/3] hw/misc/mac_via: Use via_irq_request() in via1_VBL(), via1_one_second()

Message ID 20201013204927.3660030-4-f4bug@amsat.org
State New
Headers show
Series hw/misc/mac_via: Factor generic via_irq_request() out | expand

Commit Message

Philippe Mathieu-Daudé Oct. 13, 2020, 8:49 p.m. UTC
via1_VBL() and via1_one_second() just call the generic
via_irq_request() handler raising a specific IRQ.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/misc/mac_via.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c
index 54088b6625a..00877a42447 100644
--- a/hw/misc/mac_via.c
+++ b/hw/misc/mac_via.c
@@ -341,11 +341,8 @@  static void via_irq_request(void *opaque, int irq, int level)
 static void via1_VBL(void *opaque)
 {
     MOS6522Q800VIA1State *v1s = opaque;
-    MOS6522State *s = MOS6522(v1s);
-    MOS6522DeviceClass *mdc = MOS6522_GET_CLASS(s);
 
-    s->ifr |= VIA1_IRQ_VBLANK;
-    mdc->update_irq(s);
+    via_irq_request(v1s, VIA1_IRQ_VBLANK, 1);
 
     via1_VBL_update(v1s);
 }
@@ -353,11 +350,8 @@  static void via1_VBL(void *opaque)
 static void via1_one_second(void *opaque)
 {
     MOS6522Q800VIA1State *v1s = opaque;
-    MOS6522State *s = MOS6522(v1s);
-    MOS6522DeviceClass *mdc = MOS6522_GET_CLASS(s);
 
-    s->ifr |= VIA1_IRQ_ONE_SECOND;
-    mdc->update_irq(s);
+    via_irq_request(v1s, VIA1_IRQ_ONE_SECOND, 1);
 
     via1_one_second_update(v1s);
 }