On 23/11/18 16:30, Mao Zhongyi wrote:
> Use DeviceClass rather than SysBusDeviceClass in
> puv3_intc_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: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> hw/intc/puv3_intc.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/hw/intc/puv3_intc.c b/hw/intc/puv3_intc.c
> index ef8488aacc..69ddc8c19a 100644
> --- a/hw/intc/puv3_intc.c
> +++ b/hw/intc/puv3_intc.c
> @@ -101,10 +101,10 @@ static const MemoryRegionOps puv3_intc_ops = {
> .endianness = DEVICE_NATIVE_ENDIAN,
> };
>
> -static int puv3_intc_init(SysBusDevice *sbd)
> +static void puv3_intc_realize(DeviceState *dev, Error **errp)
> {
> - DeviceState *dev = DEVICE(sbd);
> PUV3INTCState *s = PUV3_INTC(dev);
> + SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
>
> qdev_init_gpio_in(dev, puv3_intc_handler, PUV3_IRQS_NR);
> sysbus_init_irq(sbd, &s->parent_irq);
> @@ -115,15 +115,12 @@ static int puv3_intc_init(SysBusDevice *sbd)
> memory_region_init_io(&s->iomem, OBJECT(s), &puv3_intc_ops, s, "puv3_intc",
> PUV3_REGS_OFFSET);
> sysbus_init_mmio(sbd, &s->iomem);
> -
> - return 0;
> }
>
> static void puv3_intc_class_init(ObjectClass *klass, void *data)
> {
> - SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
> -
> - sdc->init = puv3_intc_init;
> + DeviceClass *dc = DEVICE_CLASS(klass);
> + dc->realize = puv3_intc_realize;
> }
>
> static const TypeInfo puv3_intc_info = {
>