Patchwork [v3,11/16] isa: use bus given in parameter to create device on specified ISA bus

login
register
mail settings
Submitter Hervé Poussineau
Date Oct. 2, 2011, 4:10 p.m.
Message ID <1317571828-9059-12-git-send-email-hpoussin@reactos.org>
Download mbox | patch
Permalink /patch/117345/
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 ecc5375..cdfed29 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -151,11 +151,12 @@  ISADevice *isa_create(ISABus *bus, const char *name)
 {
     DeviceState *dev;
 
-    if (!isabus) {
+    if (!bus) {
         hw_error("Tried to create isa device %s with no isa bus present.",
                  name);
     }
-    dev = qdev_create(&isabus->qbus, name);
+    assert(bus == isabus);
+    dev = qdev_create(&bus->qbus, name);
     return DO_UPCAST(ISADevice, qdev, dev);
 }
 
@@ -163,11 +164,12 @@  ISADevice *isa_try_create(ISABus *bus, const char *name)
 {
     DeviceState *dev;
 
-    if (!isabus) {
+    if (!bus) {
         hw_error("Tried to create isa device %s with no isa bus present.",
                  name);
     }
-    dev = qdev_try_create(&isabus->qbus, name);
+    assert(bus == isabus);
+    dev = qdev_try_create(&bus->qbus, name);
     return DO_UPCAST(ISADevice, qdev, dev);
 }