[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH 1/5] hw/display: QOM'ify exynos4210_fimd.c
From: |
xiaoqiang zhao |
Subject: |
[Qemu-arm] [PATCH 1/5] hw/display: QOM'ify exynos4210_fimd.c |
Date: |
Thu, 24 Mar 2016 18:29:26 +0800 |
* Drop the old SysBus init function and use instance_init
* Move graphic_console_init into realize stage
Signed-off-by: xiaoqiang zhao <address@hidden>
---
hw/display/exynos4210_fimd.c | 19 ++++++++++++-------
1 file 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,
};
--
2.1.4
- [Qemu-arm] [PATCH 0/5] QOM'ify hw/display devices, xiaoqiang zhao, 2016/03/24
- [Qemu-arm] [PATCH 4/5] hw/display: QOM'ify milkymist-vgafb.c, xiaoqiang zhao, 2016/03/24
- [Qemu-arm] [PATCH 2/5] hw/display: QOM'ify jazz_led.c, xiaoqiang zhao, 2016/03/24
- [Qemu-arm] [PATCH 1/5] hw/display: QOM'ify exynos4210_fimd.c,
xiaoqiang zhao <=
- [Qemu-arm] [PATCH 5/5] hw/display: QOM'ify pl110.c, xiaoqiang zhao, 2016/03/24
- [Qemu-arm] [PATCH 3/6] hw/display/jazz_led.c, xiaoqiang zhao, 2016/03/24
- [Qemu-arm] [PATCH 5/6] hw/display/milkymist-vgafb.c, xiaoqiang zhao, 2016/03/24
- [Qemu-arm] [PATCH 6/6] QOM hw/display/pl110.c, xiaoqiang zhao, 2016/03/24