aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorxiaoqiang zhao <zxq_yx_007@163.com>2016-05-13 11:46:57 +0800
committerGerd Hoffmann <kraxel@redhat.com>2016-06-03 11:13:38 +0200
commitff2df541bb1b3e92e3b6b1035468df9af28d5e29 (patch)
tree81eb640b4ea987630dc369d6db1b8ed76689915c /hw
parente58ff62d589fe147f4e73ba28a0383fb80600be6 (diff)
hw/audio: QOM'ify cs4231.c
Drop the old SysBus init function and use instance_init Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Message-id: 1463111220-30335-2-git-send-email-zxq_yx_007@163.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/audio/cs4231.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/hw/audio/cs4231.c b/hw/audio/cs4231.c
index caf97c1692..30690f96ae 100644
--- a/hw/audio/cs4231.c
+++ b/hw/audio/cs4231.c
@@ -145,16 +145,15 @@ static const VMStateDescription vmstate_cs4231 = {
}
};
-static int cs4231_init1(SysBusDevice *dev)
+static void cs4231_init(Object *obj)
{
- CSState *s = CS4231(dev);
+ CSState *s = CS4231(obj);
+ SysBusDevice *dev = SYS_BUS_DEVICE(obj);
- memory_region_init_io(&s->iomem, OBJECT(s), &cs_mem_ops, s, "cs4321",
+ memory_region_init_io(&s->iomem, obj, &cs_mem_ops, s, "cs4321",
CS_SIZE);
sysbus_init_mmio(dev, &s->iomem);
sysbus_init_irq(dev, &s->irq);
-
- return 0;
}
static Property cs4231_properties[] = {
@@ -164,9 +163,7 @@ static Property cs4231_properties[] = {
static void cs4231_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
- SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
- k->init = cs4231_init1;
dc->reset = cs_reset;
dc->vmsd = &vmstate_cs4231;
dc->props = cs4231_properties;
@@ -176,6 +173,7 @@ static const TypeInfo cs4231_info = {
.name = TYPE_CS4231,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(CSState),
+ .instance_init = cs4231_init,
.class_init = cs4231_class_init,
};