diff mbox

[v2,11/14] hw/timer: QOM'ify puv3_ost

Message ID 1453863375-7618-2-git-send-email-zxq_yx_007@163.com (mailing list archive)
State New, archived
Headers show

Commit Message

zhao xiao qiang Jan. 27, 2016, 2:56 a.m. UTC
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(-)
diff mbox

Patch

diff --git a/hw/timer/puv3_ost.c b/hw/timer/puv3_ost.c
index fa9eefd..0926c06 100644
--- a/hw/timer/puv3_ost.c
+++ b/hw/timer/puv3_ost.c
@@ -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,
 };