summaryrefslogtreecommitdiffstats
path: root/hw/core/sysbus.c
diff options
context:
space:
mode:
authorMao Zhongyi2018-12-13 14:48:03 +0100
committerPeter Maydell2018-12-13 14:48:03 +0100
commit817a17fc60f44e29a1944b60d32f45ea127f0cf9 (patch)
tree58e1a20f166f97038b9be6514ec65ae44be3f1f1 /hw/core/sysbus.c
parentxen_backend: remove xen_sysdev_init() function (diff)
downloadqemu-817a17fc60f44e29a1944b60d32f45ea127f0cf9.tar.gz
qemu-817a17fc60f44e29a1944b60d32f45ea127f0cf9.tar.xz
qemu-817a17fc60f44e29a1944b60d32f45ea127f0cf9.zip
core/sysbus: remove the SysBusDeviceClass::init path
Currently, all sysbus devices have been converted to realize(), so remove this path. Cc: ehabkost@redhat.com Cc: thuth@redhat.com Cc: pbonzini@redhat.com Cc: armbru@redhat.com Cc: peter.maydell@linaro.org Cc: richard.henderson@linaro.org Cc: alistair.francis@wdc.com Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Message-id: 20181130093852.20739-22-maozhongyi@cmss.chinamobile.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/core/sysbus.c')
-rw-r--r--hw/core/sysbus.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index 7ac36ad3e7..9f9edbcab9 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -201,18 +201,13 @@ void sysbus_init_ioports(SysBusDevice *dev, uint32_t ioport, uint32_t size)
}
}
-/* TODO remove once all sysbus devices have been converted to realize */
+/* The purpose of preserving this empty realize function
+ * is to prevent the parent_realize field of some subclasses
+ * from being set to NULL to break the normal init/realize
+ * of some devices.
+ */
static void sysbus_realize(DeviceState *dev, Error **errp)
{
- SysBusDevice *sd = SYS_BUS_DEVICE(dev);
- SysBusDeviceClass *sbc = SYS_BUS_DEVICE_GET_CLASS(sd);
-
- if (!sbc->init) {
- return;
- }
- if (sbc->init(sd) < 0) {
- error_setg(errp, "Device initialization failed");
- }
}
DeviceState *sysbus_create_varargs(const char *name,