[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 18/22] hw/ssi/pl022: Use DeviceState::realize ra
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 18/22] hw/ssi/pl022: Use DeviceState::realize rather than SysBusDevice::init |
Date: |
Tue, 21 Aug 2018 03:53:01 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 08/20/2018 11:11 AM, Peter Maydell wrote:
> Move from the legacy SysBusDevice::init method to using
> DeviceState::realize.
It would be nice to have a wiki page where each maintainer list his
deprecated/legacy API and which current API to use instead (and why,
some examples how to use or port, pointing to git commits).
>
> Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> hw/ssi/pl022.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/hw/ssi/pl022.c b/hw/ssi/pl022.c
> index c9989537062..3ac57f4c96a 100644
> --- a/hw/ssi/pl022.c
> +++ b/hw/ssi/pl022.c
> @@ -270,26 +270,24 @@ static const VMStateDescription vmstate_pl022 = {
> }
> };
>
> -static int pl022_init(SysBusDevice *sbd)
> +static void pl022_realize(DeviceState *dev, Error **errp)
> {
> - DeviceState *dev = DEVICE(sbd);
> + SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
> PL022State *s = PL022(dev);
>
> memory_region_init_io(&s->iomem, OBJECT(s), &pl022_ops, s, "pl022",
> 0x1000);
> sysbus_init_mmio(sbd, &s->iomem);
> sysbus_init_irq(sbd, &s->irq);
> s->ssi = ssi_create_bus(dev, "ssi");
> - return 0;
> }
>
> static void pl022_class_init(ObjectClass *klass, void *data)
> {
> - SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
> DeviceClass *dc = DEVICE_CLASS(klass);
>
> - sdc->init = pl022_init;
> dc->reset = pl022_reset;
> dc->vmsd = &vmstate_pl022;
> + dc->realize = pl022_realize;
> }
>
> static const TypeInfo pl022_info = {
>
- [Qemu-devel] [PATCH 14/22] hw/arm/mps2-tz: Create PL081s and MSCs, (continued)
- [Qemu-devel] [PATCH 14/22] hw/arm/mps2-tz: Create PL081s and MSCs, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 15/22] hw/ssi/pl022: Allow use as embedded-struct device, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 13/22] hw/arm/iotkit: Wire up the lines for MSCs, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 17/22] hw/ssi/pl022: Don't directly call vmstate_register(), Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 18/22] hw/ssi/pl022: Use DeviceState::realize rather than SysBusDevice::init, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 16/22] hw/ssi/pl022: Set up reset function in class init, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 20/22] hw/ssi/pl022: Correct wrong DMACR and ICR handling, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 22/22] hw/arm/mps2-tz: Fix MPS2 SCC config register values, Peter Maydell, 2018/08/20