Patchwork [v3,13/16] isa: use bus given in parameter to get/set irqs on specified ISA bus

login
register
mail settings
Submitter Hervé Poussineau
Date Oct. 2, 2011, 4:10 p.m.
Message ID <1317571828-9059-14-git-send-email-hpoussin@reactos.org>
Download mbox | patch
Permalink /patch/117343/
State New
Headers show

Comments

Hervé Poussineau - Oct. 2, 2011, 4:10 p.m.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/isa-bus.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

Patch

diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 4a95834..2f9ad24 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -60,10 +60,11 @@  void isa_bus_new(ISABus *bus, ISABusOps *ops, DeviceState *host)
 
 void isa_bus_irqs(ISABus *bus, qemu_irq *irqs)
 {
-    if (!isabus || !isabus->ops->set_irqs) {
+    if (!bus || !bus->ops->set_irqs) {
         hw_error("Tried to set isa irqs with no isa bus present.");
     }
-    isabus->ops->set_irqs(isabus, irqs);
+    assert(bus == isabus);
+    bus->ops->set_irqs(bus, irqs);
 }
 
 /*
@@ -74,10 +75,11 @@  void isa_bus_irqs(ISABus *bus, qemu_irq *irqs)
  */
 qemu_irq isa_get_irq(ISABus *bus, int isairq)
 {
-    if (!isabus || !isabus->ops->get_irq) {
+    if (!bus || !bus->ops->get_irq) {
         hw_error("ISA bus invalid");
     }
-    return isabus->ops->get_irq(isabus, isairq);
+    assert(bus == isabus);
+    return bus->ops->get_irq(bus, isairq);
 }
 
 void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq)