Patchwork [5/6] Make isa_create() terminate program on failure

login
register
mail settings
Submitter Markus Armbruster
Date Sept. 11, 2009, 8:19 p.m.
Message ID <66a72b5dfa80db634d573bb5b4d91442be5513d2.1252699478.git.armbru@redhat.com>
Download mbox | patch
Permalink /patch/33493/
State Superseded
Headers show

Comments

Markus Armbruster - Sept. 11, 2009, 8:19 p.m.
Callers don't check the return value anyway.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/isa-bus.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

Patch

diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index f7e73d2..4d489d2 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -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;
 }