summary refs log tree commit diff stats
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-07-03 16:59:44 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-07-03 16:59:44 +0100
commit581e109d5836f5166d15a01c43e18632f93357c5 (patch)
treeccb274d67d7ef4361d41b2d404bbf8e23106f7c8 /hw
parent40d9d2f7682c789404ed5b249012ac44f9e6ea8f (diff)
downloadfocaccia-qemu-581e109d5836f5166d15a01c43e18632f93357c5.tar.gz
focaccia-qemu-581e109d5836f5166d15a01c43e18632f93357c5.zip
ssi: Add ssi_realize_and_unref()
Add an ssi_realize_and_unref(), for the benefit of callers
who want to be able to create an SSI device, set QOM properties
on it, and then do the realize-and-unref afterwards.

The API works on the same principle as the recently added
qdev_realize_and_undef(), sysbus_realize_and_undef(), etc.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20200628142429.17111-9-peter.maydell@linaro.org
Diffstat (limited to 'hw')
-rw-r--r--hw/ssi/ssi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c
index 67b48c31cd..a35d7ebb26 100644
--- a/hw/ssi/ssi.c
+++ b/hw/ssi/ssi.c
@@ -90,11 +90,16 @@ static const TypeInfo ssi_slave_info = {
     .abstract = true,
 };
 
+bool ssi_realize_and_unref(DeviceState *dev, SSIBus *bus, Error **errp)
+{
+    return qdev_realize_and_unref(dev, &bus->parent_obj, errp);
+}
+
 DeviceState *ssi_create_slave(SSIBus *bus, const char *name)
 {
     DeviceState *dev = qdev_new(name);
 
-    qdev_realize_and_unref(dev, &bus->parent_obj, &error_fatal);
+    ssi_realize_and_unref(dev, bus, &error_fatal);
     return dev;
 }