]> Git Repo - qemu.git/commitdiff
s390x: Replace unchecked qdev_init() by qdev_init_nofail()
authorMarkus Armbruster <[email protected]>
Thu, 5 Feb 2015 09:34:49 +0000 (10:34 +0100)
committerCornelia Huck <[email protected]>
Mon, 16 Mar 2015 09:15:44 +0000 (10:15 +0100)
s390_flic_init() is a helper to create and realize either
"s390-flic-kvm" or "s390-flic-qemu".  When qdev_init() fails, it
complains to stderr and succeeds.

Except it can't actually fail, because the "s390-flic-qemu" is a dummy
without a realize method, and "s390-flic-kvm"'s realize can't fail,
even when the kernel device is really unavailable.  Odd.

Replace qdev_init() by qdev_init_nofail() to make "can't fail" locally
obvious, and get rid of the unreachable error reporting.

Cc: Christian Borntraeger <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Alexander Graf <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Acked-by: Cornelia Huck <[email protected]>
Message-Id: <1423128889[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
hw/intc/s390_flic.c

index 03c5e89f4eae420d66fdf900f628d30b2deb7531..02e10b750db8733a0ed13c4ea3742b7182843362 100644 (file)
@@ -30,7 +30,6 @@ S390FLICState *s390_get_flic(void)
 void s390_flic_init(void)
 {
     DeviceState *dev;
-    int r;
 
     dev = s390_flic_kvm_create();
     if (!dev) {
@@ -38,10 +37,7 @@ void s390_flic_init(void)
         object_property_add_child(qdev_get_machine(), TYPE_QEMU_S390_FLIC,
                                   OBJECT(dev), NULL);
     }
-    r = qdev_init(dev);
-    if (r) {
-        error_report("flic: couldn't create qdev");
-    }
+    qdev_init_nofail(dev);
 }
 
 static int qemu_s390_register_io_adapter(S390FLICState *fs, uint32_t id,
This page took 0.023983 seconds and 4 git commands to generate.