isa: always use provided ISA bus when creating an isa device

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Hervé Poussineau 2011-12-15 22:09:59 +01:00 committed by Anthony Liguori
parent 142e978748
commit 75782268d6

View File

@ -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);
}