summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorxiaoqiang zhao <zxq_yx_007@163.com>2016-06-14 15:59:14 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-06-14 15:59:14 +0100
commitda8060bfc01d27b4c3d6d6646522355b0b12df6c (patch)
tree7a984b4abd59aaf26f94bda53ae6aa936382070b /hw
parent5367766742f9d4ba5c5bb0a390c653a93db504f8 (diff)
downloadqemu-da8060bfc01d27b4c3d6d6646522355b0b12df6c.tar.gz
qemu-da8060bfc01d27b4c3d6d6646522355b0b12df6c.tar.bz2
qemu-da8060bfc01d27b4c3d6d6646522355b0b12df6c.zip
hw/misc: QOM'ify arm_l2x0.c
Drop the old SysBus init function and use instance_init Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Message-id: 1465815255-21776-9-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/misc/arm_l2x0.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/hw/misc/arm_l2x0.c b/hw/misc/arm_l2x0.c
index 4442227877..66a0787c47 100644
--- a/hw/misc/arm_l2x0.c
+++ b/hw/misc/arm_l2x0.c
@@ -159,14 +159,14 @@ static const MemoryRegionOps l2x0_mem_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-static int l2x0_priv_init(SysBusDevice *dev)
+static void l2x0_priv_init(Object *obj)
{
- L2x0State *s = ARM_L2X0(dev);
+ L2x0State *s = ARM_L2X0(obj);
+ SysBusDevice *dev = SYS_BUS_DEVICE(obj);
- memory_region_init_io(&s->iomem, OBJECT(dev), &l2x0_mem_ops, s,
+ memory_region_init_io(&s->iomem, obj, &l2x0_mem_ops, s,
"l2x0_cc", 0x1000);
sysbus_init_mmio(dev, &s->iomem);
- return 0;
}
static Property l2x0_properties[] = {
@@ -176,10 +176,8 @@ static Property l2x0_properties[] = {
static void l2x0_class_init(ObjectClass *klass, void *data)
{
- SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
DeviceClass *dc = DEVICE_CLASS(klass);
- k->init = l2x0_priv_init;
dc->vmsd = &vmstate_l2x0;
dc->props = l2x0_properties;
dc->reset = l2x0_priv_reset;
@@ -189,6 +187,7 @@ static const TypeInfo l2x0_info = {
.name = TYPE_ARM_L2X0,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(L2x0State),
+ .instance_init = l2x0_priv_init,
.class_init = l2x0_class_init,
};