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>
This commit is contained in:
Mao Zhongyi 2018-12-13 13:48:03 +00:00 committed by Peter Maydell
parent 57fe9b4d9b
commit 817a17fc60
2 changed files with 5 additions and 13 deletions

View File

@ -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,

View File

@ -38,9 +38,6 @@ typedef struct SysBusDevice SysBusDevice;
typedef struct SysBusDeviceClass {
/*< private >*/
DeviceClass parent_class;
/*< public >*/
int (*init)(SysBusDevice *dev);
/*
* Let the sysbus device format its own non-PIO, non-MMIO unit address.