aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMao Zhongyi <maozhongyi@cmss.chinamobile.com>2018-12-13 13:47:58 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-12-13 13:47:58 +0000
commit8ba7f72611bd879fa6c188dde64af3e09f8dad21 (patch)
tree61c8ef85e908fc0cc18f170ae9e5f6e8aac9284e /hw
parent0323ee4321641d4cebf4b53af18a205536cb3dd6 (diff)
dma/puv3_dma: Convert sysbus init function to realize function
Use DeviceClass rather than SysBusDeviceClass in puv3_dma_class_init(). Cc: gxt@mprc.pku.edu.cn Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20181130093852.20739-7-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/dma/puv3_dma.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/hw/dma/puv3_dma.c b/hw/dma/puv3_dma.c
index b97a6c1767..c89eade029 100644
--- a/hw/dma/puv3_dma.c
+++ b/hw/dma/puv3_dma.c
@@ -76,7 +76,7 @@ static const MemoryRegionOps puv3_dma_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-static int puv3_dma_init(SysBusDevice *dev)
+static void puv3_dma_realize(DeviceState *dev, Error **errp)
{
PUV3DMAState *s = PUV3_DMA(dev);
int i;
@@ -87,16 +87,14 @@ static int puv3_dma_init(SysBusDevice *dev)
memory_region_init_io(&s->iomem, OBJECT(s), &puv3_dma_ops, s, "puv3_dma",
PUV3_REGS_OFFSET);
- sysbus_init_mmio(dev, &s->iomem);
-
- return 0;
+ sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
}
static void puv3_dma_class_init(ObjectClass *klass, void *data)
{
- SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
+ DeviceClass *dc = DEVICE_CLASS(klass);
- sdc->init = puv3_dma_init;
+ dc->realize = puv3_dma_realize;
}
static const TypeInfo puv3_dma_info = {