aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorxiaoqiang zhao <zxq_yx_007@163.com>2016-05-12 13:22:27 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-05-12 13:22:27 +0100
commit3c09d6caad07b141291a3dd1630b1043aecef3ff (patch)
tree3a0276f8366a817da4af673929c53baab25a9490 /hw
parentcd694521ca061a5d0436d5df4ec8c17c8f4dfcdb (diff)
downloadqemu-3c09d6caad07b141291a3dd1630b1043aecef3ff.zip
qemu-3c09d6caad07b141291a3dd1630b1043aecef3ff.tar.gz
qemu-3c09d6caad07b141291a3dd1630b1043aecef3ff.tar.bz2
hw/display: QOM'ify exynos4210_fimd.c
* Drop the old SysBus init function and use instance_init * Move graphic_console_init into realize stage Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Message-id: 1462417489-28603-2-git-send-email-zxq_yx_007@163.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/display/exynos4210_fimd.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c
index 728eb21..e5be713 100644
--- a/hw/display/exynos4210_fimd.c
+++ b/hw/display/exynos4210_fimd.c
@@ -1909,9 +1909,10 @@ static const GraphicHwOps exynos4210_fimd_ops = {
.gfx_update = exynos4210_fimd_update,
};
-static int exynos4210_fimd_init(SysBusDevice *dev)
+static void exynos4210_fimd_init(Object *obj)
{
- Exynos4210fimdState *s = EXYNOS4210_FIMD(dev);
+ Exynos4210fimdState *s = EXYNOS4210_FIMD(obj);
+ SysBusDevice *dev = SYS_BUS_DEVICE(obj);
s->ifb = NULL;
@@ -1919,28 +1920,32 @@ static int exynos4210_fimd_init(SysBusDevice *dev)
sysbus_init_irq(dev, &s->irq[1]);
sysbus_init_irq(dev, &s->irq[2]);
- memory_region_init_io(&s->iomem, OBJECT(s), &exynos4210_fimd_mmio_ops, s,
+ memory_region_init_io(&s->iomem, obj, &exynos4210_fimd_mmio_ops, s,
"exynos4210.fimd", FIMD_REGS_SIZE);
sysbus_init_mmio(dev, &s->iomem);
- s->console = graphic_console_init(DEVICE(dev), 0, &exynos4210_fimd_ops, s);
+}
- return 0;
+static void exynos4210_fimd_realize(DeviceState *dev, Error **errp)
+{
+ Exynos4210fimdState *s = EXYNOS4210_FIMD(dev);
+
+ s->console = graphic_console_init(dev, 0, &exynos4210_fimd_ops, s);
}
static void exynos4210_fimd_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
- SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
dc->vmsd = &exynos4210_fimd_vmstate;
dc->reset = exynos4210_fimd_reset;
- k->init = exynos4210_fimd_init;
+ dc->realize = exynos4210_fimd_realize;
}
static const TypeInfo exynos4210_fimd_info = {
.name = TYPE_EXYNOS4210_FIMD,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(Exynos4210fimdState),
+ .instance_init = exynos4210_fimd_init,
.class_init = exynos4210_fimd_class_init,
};