[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH 5/5] hw/display: QOM'ify pl110.c
From: |
xiaoqiang zhao |
Subject: |
[Qemu-arm] [PATCH 5/5] hw/display: QOM'ify pl110.c |
Date: |
Thu, 24 Mar 2016 18:29:33 +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/pl110.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/hw/display/pl110.c b/hw/display/pl110.c
index d589959..61418da 100644
--- a/hw/display/pl110.c
+++ b/hw/display/pl110.c
@@ -465,24 +465,24 @@ static const GraphicHwOps pl110_gfx_ops = {
.gfx_update = pl110_update_display,
};
-static int pl110_initfn(SysBusDevice *sbd)
+static void pl110_init(Object *obj)
{
- DeviceState *dev = DEVICE(sbd);
- PL110State *s = PL110(dev);
+ DeviceState *dev = DEVICE(obj);
+ PL110State *s = PL110(obj);
+ SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
- memory_region_init_io(&s->iomem, OBJECT(s), &pl110_ops, s, "pl110",
0x1000);
+ memory_region_init_io(&s->iomem, obj, &pl110_ops, s, "pl110", 0x1000);
sysbus_init_mmio(sbd, &s->iomem);
sysbus_init_irq(sbd, &s->irq);
qdev_init_gpio_in(dev, pl110_mux_ctrl_set, 1);
- s->con = graphic_console_init(dev, 0, &pl110_gfx_ops, s);
- return 0;
}
-static void pl110_init(Object *obj)
+static void pl110_realize(DeviceState *dev, Error **errp)
{
- PL110State *s = PL110(obj);
+ PL110State *s = PL110(dev);
s->version = PL110;
+ s->con = graphic_console_init(dev, 0, &pl110_gfx_ops, s);
}
static void pl110_versatile_init(Object *obj)
@@ -502,11 +502,10 @@ static void pl111_init(Object *obj)
static void pl110_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
- SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
- k->init = pl110_initfn;
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
dc->vmsd = &vmstate_pl110;
+ dc->realize = pl110_realize;
}
static const TypeInfo pl110_info = {
--
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, 2016/03/24
- [Qemu-arm] [PATCH 5/5] hw/display: QOM'ify pl110.c,
xiaoqiang zhao <=
- [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