aboutsummaryrefslogtreecommitdiff
path: root/hw/isa-bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/isa-bus.c')
-rw-r--r--hw/isa-bus.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 3cc17b28f2..4ecc0f8399 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -109,7 +109,7 @@ void isa_qdev_register(ISADeviceInfo *info)
qdev_register(&info->qdev);
}
-ISADevice *isa_create_simple(const char *name)
+ISADevice *isa_create(const char *name)
{
DeviceState *dev;
@@ -118,10 +118,21 @@ ISADevice *isa_create_simple(const char *name)
return NULL;
}
dev = qdev_create(&isabus->qbus, name);
- qdev_init(dev);
return DO_UPCAST(ISADevice, qdev, dev);
}
+ISADevice *isa_create_simple(const char *name)
+{
+ ISADevice *dev;
+
+ dev = isa_create(name);
+ if (qdev_init(&dev->qdev) != 0) {
+ qdev_free(&dev->qdev);
+ return NULL;
+ }
+ return dev;
+}
+
static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent)
{
ISADevice *d = DO_UPCAST(ISADevice, qdev, dev);