• 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

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

Log Message

puv3_pm.c: Convert sysbus init function to realize function

Use DeviceClass rather than SysBusDeviceClass in
puv3_pm_class_init().

Cc: gxt@mprc.pku.edu.cn

Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20181130093852.20739-14-maozhongyi@cmss.chinamobile.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Change Summary

差異

--- a/hw/misc/puv3_pm.c
+++ b/hw/misc/puv3_pm.c
@@ -119,7 +119,7 @@ static const MemoryRegionOps puv3_pm_ops = {
119119 .endianness = DEVICE_NATIVE_ENDIAN,
120120 };
121121
122-static int puv3_pm_init(SysBusDevice *dev)
122+static void puv3_pm_realize(DeviceState *dev, Error **errp)
123123 {
124124 PUV3PMState *s = PUV3_PM(dev);
125125
@@ -127,16 +127,14 @@ static int puv3_pm_init(SysBusDevice *dev)
127127
128128 memory_region_init_io(&s->iomem, OBJECT(s), &puv3_pm_ops, s, "puv3_pm",
129129 PUV3_REGS_OFFSET);
130- sysbus_init_mmio(dev, &s->iomem);
131-
132- return 0;
130+ sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
133131 }
134132
135133 static void puv3_pm_class_init(ObjectClass *klass, void *data)
136134 {
137- SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
135+ DeviceClass *dc = DEVICE_CLASS(klass);
138136
139- sdc->init = puv3_pm_init;
137+ dc->realize = puv3_pm_realize;
140138 }
141139
142140 static const TypeInfo puv3_pm_info = {