[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/22] core/empty_slot: Convert sysbus init func
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 04/22] core/empty_slot: Convert sysbus init function to realize function |
Date: |
Tue, 20 Nov 2018 14:48:13 +0000 |
On 19 November 2018 at 12:08, Mao Zhongyi
<address@hidden> wrote:
> Use DeviceClass rather than SysBusDeviceClass in
> empty_slot_class_init().
>
> Signed-off-by: Mao Zhongyi <address@hidden>
> Signed-off-by: Zhang Shengju <address@hidden>
> ---
> hw/core/empty_slot.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/hw/core/empty_slot.c b/hw/core/empty_slot.c
> index c1b9c2b104..239f78e2a7 100644
> --- a/hw/core/empty_slot.c
> +++ b/hw/core/empty_slot.c
> @@ -71,21 +71,20 @@ void empty_slot_init(hwaddr addr, uint64_t slot_size)
> }
> }
>
> -static int empty_slot_init1(SysBusDevice *dev)
> +static void empty_slot_realize(DeviceState *dev, Error **errp)
> {
> EmptySlot *s = EMPTY_SLOT(dev);
>
> memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s,
> "empty-slot", s->size);
> - sysbus_init_mmio(dev, &s->iomem);
> - return 0;
> + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
> }
>
> static void empty_slot_class_init(ObjectClass *klass, void *data)
> {
> - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
> + DeviceClass *dc = DEVICE_CLASS(klass);
>
> - k->init = empty_slot_init1;
> + dc->realize = empty_slot_realize;
> }
>
> static const TypeInfo empty_slot_info = {
Reviewed-by: Peter Maydell <address@hidden>
thanks
-- PMM
- [Qemu-devel] [PATCH 00/22] QOM'ify SysBusDeviceClass->init, Mao Zhongyi, 2018/11/19
- [Qemu-devel] [PATCH 06/22] dma/puv3_dma: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/19
- [Qemu-devel] [PATCH 08/22] milkymist-softusb: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/19
- [Qemu-devel] [PATCH 22/22] core/sysbus: remove the SysBusDeviceClass::init path, Mao Zhongyi, 2018/11/19
- [Qemu-devel] [PATCH 09/22] input/pl050: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/19
- [Qemu-devel] [PATCH 04/22] core/empty_slot: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/19
- [Qemu-devel] [PATCH 12/22] milkymist-pfpu: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/19
- [Qemu-devel] [PATCH 11/22] milkymist-hpdmc: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/19
- [Qemu-devel] [PATCH 15/22] pci-bridge/dec: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/19
- [Qemu-devel] [PATCH 20/22] xen_backend: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/19
- [Qemu-devel] [PATCH 14/22] nvram/ds1225y: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/19