aboutsummaryrefslogtreecommitdiff
path: root/hw/misc
diff options
context:
space:
mode:
Diffstat (limited to 'hw/misc')
-rw-r--r--hw/misc/empty_slot.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c
index b568ae202b..eb2aec731e 100644
--- a/hw/misc/empty_slot.c
+++ b/hw/misc/empty_slot.c
@@ -13,6 +13,7 @@
#include "hw/sysbus.h"
#include "hw/qdev-properties.h"
#include "hw/misc/empty_slot.h"
+#include "qapi/error.h"
#include "trace.h"
#define TYPE_EMPTY_SLOT "empty_slot"
@@ -56,10 +57,10 @@ void empty_slot_init(const char *name, hwaddr addr, uint64_t slot_size)
/* Only empty slots larger than 0 byte need handling. */
DeviceState *dev;
- dev = qdev_create(NULL, TYPE_EMPTY_SLOT);
+ dev = qdev_new(TYPE_EMPTY_SLOT);
qdev_prop_set_uint64(dev, "size", slot_size);
- qdev_init_nofail(dev);
+ qdev_realize_and_unref(dev, NULL, &error_fatal);
sysbus_mmio_map_overlap(SYS_BUS_DEVICE(dev), 0, addr, -10000);
}