• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂817a17fc60f44e29a1944b60d32f45ea127f0cf9 (tree)
時間2018-12-13 22:48:03
作者Mao Zhongyi <maozhongyi@cmss...>
CommiterPeter Maydell

Log Message

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>

Change Summary

差異

--- 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)
201201 }
202202 }
203203
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+ */
205209 static void sysbus_realize(DeviceState *dev, Error **errp)
206210 {
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- }
216211 }
217212
218213 DeviceState *sysbus_create_varargs(const char *name,
--- a/include/hw/sysbus.h
+++ b/include/hw/sysbus.h
@@ -38,9 +38,6 @@ typedef struct SysBusDevice SysBusDevice;
3838 typedef struct SysBusDeviceClass {
3939 /*< private >*/
4040 DeviceClass parent_class;
41- /*< public >*/
42-
43- int (*init)(SysBusDevice *dev);
4441
4542 /*
4643 * Let the sysbus device format its own non-PIO, non-MMIO unit address.