aboutsummaryrefslogtreecommitdiff
path: root/hw/ide/qdev.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-06-25 18:53:22 +0200
committerKevin Wolf <kwolf@redhat.com>2010-07-02 13:18:01 +0200
commitfa12fbbecefc6f9bf20374daa275a598096d113c (patch)
treec0fa0f87f351a01164bdc59e8b59d2ddd5502ce7 /hw/ide/qdev.c
parentfa66b909f382619da15f8c7e323145adfa94fdac (diff)
ide: Make it explicit that ide_create_drive() can't fail
All callers of ide_create_drive() ignore its value. Currently harmless, because it fails only when qdev_init() fails, which fails only when ide_drive_initfn() fails, which never fails. Brittle. Change it to die instead of silently ignoring failure. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/qdev.c')
-rw-r--r--hw/ide/qdev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 0f9f22e30f..127478ba65 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -84,8 +84,7 @@ IDEDevice *ide_create_drive(IDEBus *bus, int unit, DriveInfo *drive)
dev = qdev_create(&bus->qbus, "ide-drive");
qdev_prop_set_uint32(dev, "unit", unit);
qdev_prop_set_drive(dev, "drive", drive);
- if (qdev_init(dev) < 0)
- return NULL;
+ qdev_init_nofail(dev);
return DO_UPCAST(IDEDevice, qdev, dev);
}