Make isa_create() terminate program on failure
authorMarkus Armbruster <armbru@redhat.com>
Tue, 6 Oct 2009 23:15:59 +0000 (01:15 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 7 Oct 2009 13:54:54 +0000 (08:54 -0500)
Callers don't check the return value anyway.

Patchworks-ID: 35172
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/isa-bus.c

index f7e73d2..4d489d2 100644 (file)
@@ -114,8 +114,8 @@ ISADevice *isa_create(const char *name)
     DeviceState *dev;
 
     if (!isabus) {
-        fprintf(stderr, "Tried to create isa device %s with no isa bus present.\n", name);
-        return NULL;
+        hw_error("Tried to create isa device %s with no isa bus present.\n",
+                 name);
     }
     dev = qdev_create(&isabus->qbus, name);
     return DO_UPCAST(ISADevice, qdev, dev);
@@ -126,9 +126,7 @@ ISADevice *isa_create_simple(const char *name)
     ISADevice *dev;
 
     dev = isa_create(name);
-    if (qdev_init(&dev->qdev) != 0) {
-        return NULL;
-    }
+    qdev_init_nofail(&dev->qdev);
     return dev;
 }