Patchwork [v3,09/11] isa: always use provided ISA bus when creating an isa device

login
register
mail settings
Submitter Hervé Poussineau
Date Dec. 15, 2011, 9:09 p.m.
Message ID <1323983401-18345-10-git-send-email-hpoussin@reactos.org>
Download mbox | patch
Permalink /patch/131746/
State New
Headers show

Comments

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

Patch

diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 7c94f0b..3207680 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -130,12 +130,11 @@  ISADevice *isa_create(ISABus *bus, const char *name)
 {
     DeviceState *dev;
 
-    assert(!bus || bus == isabus);
-    if (!isabus) {
+    if (!bus) {
         hw_error("Tried to create isa device %s with no isa bus present.",
                  name);
     }
-    dev = qdev_create(&isabus->qbus, name);
+    dev = qdev_create(&bus->qbus, name);
     return DO_UPCAST(ISADevice, qdev, dev);
 }
 
@@ -143,12 +142,11 @@  ISADevice *isa_try_create(ISABus *bus, const char *name)
 {
     DeviceState *dev;
 
-    assert(!bus || bus == isabus);
-    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);
+    dev = qdev_try_create(&bus->qbus, name);
     return DO_UPCAST(ISADevice, qdev, dev);
 }