@@ -112,9 +112,10 @@ static void puv3_ost_tick(void *opaque)
}
}
-static int puv3_ost_init(SysBusDevice *dev)
+static void puv3_ost_init(Object *obj)
{
- PUV3OSTState *s = PUV3_OST(dev);
+ PUV3OSTState *s = PUV3_OST(obj);
+ SysBusDevice *dev = SYS_BUS_DEVICE(obj);
s->reg_OIER = 0;
s->reg_OSSR = 0;
@@ -130,21 +131,18 @@ static int puv3_ost_init(SysBusDevice *dev)
memory_region_init_io(&s->iomem, OBJECT(s), &puv3_ost_ops, s, "puv3_ost",
PUV3_REGS_OFFSET);
sysbus_init_mmio(dev, &s->iomem);
-
- return 0;
}
static void puv3_ost_class_init(ObjectClass *klass, void *data)
{
- SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
-
- sdc->init = puv3_ost_init;
+ /* do nothing */
}
static const TypeInfo puv3_ost_info = {
.name = TYPE_PUV3_OST,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(PUV3OSTState),
+ .instance_init = puv3_ost_init,
.class_init = puv3_ost_class_init,
};
assign puv3_ost_init to puv3_ost_info.instance_init and drop the SysBusDeviceClass::init Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> --- hw/timer/puv3_ost.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)