修訂 | 817a17fc60f44e29a1944b60d32f45ea127f0cf9 (tree) |
---|---|
時間 | 2018-12-13 22:48:03 |
作者 | Mao Zhongyi <maozhongyi@cmss...> |
Commiter | Peter Maydell |
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>
@@ -201,18 +201,13 @@ void sysbus_init_ioports(SysBusDevice *dev, uint32_t ioport, uint32_t size) | ||
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
204 | -/* TODO remove once all sysbus devices have been converted to realize */ | |
204 | +/* The purpose of preserving this empty realize function | |
205 | + * is to prevent the parent_realize field of some subclasses | |
206 | + * from being set to NULL to break the normal init/realize | |
207 | + * of some devices. | |
208 | + */ | |
205 | 209 | static void sysbus_realize(DeviceState *dev, Error **errp) |
206 | 210 | { |
207 | - SysBusDevice *sd = SYS_BUS_DEVICE(dev); | |
208 | - SysBusDeviceClass *sbc = SYS_BUS_DEVICE_GET_CLASS(sd); | |
209 | - | |
210 | - if (!sbc->init) { | |
211 | - return; | |
212 | - } | |
213 | - if (sbc->init(sd) < 0) { | |
214 | - error_setg(errp, "Device initialization failed"); | |
215 | - } | |
216 | 211 | } |
217 | 212 | |
218 | 213 | DeviceState *sysbus_create_varargs(const char *name, |
@@ -38,9 +38,6 @@ typedef struct SysBusDevice SysBusDevice; | ||
38 | 38 | typedef struct SysBusDeviceClass { |
39 | 39 | /*< private >*/ |
40 | 40 | DeviceClass parent_class; |
41 | - /*< public >*/ | |
42 | - | |
43 | - int (*init)(SysBusDevice *dev); | |
44 | 41 | |
45 | 42 | /* |
46 | 43 | * Let the sysbus device format its own non-PIO, non-MMIO unit address. |