[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PULL 07/45] hw/timer/sun4v-rtc: Use DeviceState::realize
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [PULL 07/45] hw/timer/sun4v-rtc: Use DeviceState::realize rather than SysBusDevice::init |
Date: |
Tue, 23 Oct 2018 16:10:48 +0100 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Thu, Oct 18, 2018 at 05:03:44PM -0300, Eduardo Habkost wrote:
> From: Philippe Mathieu-Daudé <address@hidden>
>
> Move from the legacy SysBusDevice::init method to using DeviceState::realize.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> Reviewed-by: Thomas Huth <address@hidden>
> Reviewed-by: Cédric Le Goater <address@hidden>
> Message-Id: <address@hidden>
> Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: David Gibson <address@hidden>
> ---
> hw/timer/sun4v-rtc.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/hw/timer/sun4v-rtc.c b/hw/timer/sun4v-rtc.c
> index 13be94f8da..4e7f6a1eff 100644
> --- a/hw/timer/sun4v-rtc.c
> +++ b/hw/timer/sun4v-rtc.c
> @@ -63,21 +63,21 @@ void sun4v_rtc_init(hwaddr addr)
> sysbus_mmio_map(s, 0, addr);
> }
>
> -static int sun4v_rtc_init1(SysBusDevice *dev)
> +static void sun4v_rtc_realize(DeviceState *dev, Error **errp)
> {
> + SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
> Sun4vRtc *s = SUN4V_RTC(dev);
>
> memory_region_init_io(&s->iomem, OBJECT(s), &sun4v_rtc_ops, s,
> "sun4v-rtc", 0x08ULL);
> - sysbus_init_mmio(dev, &s->iomem);
> - return 0;
> + sysbus_init_mmio(sbd, &s->iomem);
> }
>
> static void sun4v_rtc_class_init(ObjectClass *klass, void *data)
> {
> - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
> + DeviceClass *dc = DEVICE_CLASS(klass);
>
> - k->init = sun4v_rtc_init1;
> + dc->realize = sun4v_rtc_realize;
> }
>
> static const TypeInfo sun4v_rtc_info = {
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- [Qemu-ppc] [PULL 04/45] numa: Fix QMP command set-numa-node error handling, (continued)
- [Qemu-ppc] [PULL 04/45] numa: Fix QMP command set-numa-node error handling, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 05/45] trace-events: Fix copy/paste typo, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 06/45] hw/timer/sun4v-rtc: Convert from DPRINTF() macro to trace events, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 11/45] hw/mips/gt64xxx_pci: Convert gt64120_reset() function into Device reset method, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 08/45] hw/ssi/xilinx_spi: Use DeviceState::realize rather than SysBusDevice::init, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 07/45] hw/timer/sun4v-rtc: Use DeviceState::realize rather than SysBusDevice::init, Eduardo Habkost, 2018/10/18
- Re: [Qemu-ppc] [PULL 07/45] hw/timer/sun4v-rtc: Use DeviceState::realize rather than SysBusDevice::init,
David Gibson <=
- [Qemu-ppc] [PULL 10/45] hw/pci-host/bonito: Use DeviceState::realize rather than SysBusDevice::init, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 09/45] hw/sh4/sh_pci: Use DeviceState::realize rather than SysBusDevice::init, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 12/45] hw/mips/gt64xxx_pci: Mark as bridge device, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 13/45] hw/sparc64/niagara: Model the I/O Bridge with the 'unimplemented_device', Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 14/45] hw/alpha/typhoon: Remove unuseful code, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 15/45] hw/hppa/dino: Remove unuseful code, Eduardo Habkost, 2018/10/18