[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PULL 10/45] hw/pci-host/bonito: Use DeviceState::realize
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [PULL 10/45] hw/pci-host/bonito: Use DeviceState::realize rather than SysBusDevice::init |
Date: |
Tue, 23 Oct 2018 16:14:08 +0100 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Thu, Oct 18, 2018 at 05:03:47PM -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>
> Message-Id: <address@hidden>
> Reviewed-by: Peter Maydell <address@hidden>
> Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: David Gibson <address@hidden>
> ---
> hw/pci-host/bonito.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
> index 9868e2eccc..9f33582706 100644
> --- a/hw/pci-host/bonito.c
> +++ b/hw/pci-host/bonito.c
> @@ -595,7 +595,7 @@ static const VMStateDescription vmstate_bonito = {
> }
> };
>
> -static int bonito_pcihost_initfn(SysBusDevice *dev)
> +static void bonito_pcihost_realize(DeviceState *dev, Error **errp)
> {
> PCIHostState *phb = PCI_HOST_BRIDGE(dev);
>
> @@ -603,8 +603,6 @@ static int bonito_pcihost_initfn(SysBusDevice *dev)
> pci_bonito_set_irq, pci_bonito_map_irq,
> dev, get_system_memory(),
> get_system_io(),
> 0x28, 32, TYPE_PCI_BUS);
> -
> - return 0;
> }
>
> static void bonito_realize(PCIDevice *dev, Error **errp)
> @@ -684,7 +682,6 @@ PCIBus *bonito_init(qemu_irq *pic)
> pcihost->pic = pic;
> qdev_init_nofail(dev);
>
> - /* set the pcihost pointer before bonito_initfn is called */
> d = pci_create(phb->bus, PCI_DEVFN(0, 0), TYPE_PCI_BONITO);
> s = PCI_BONITO(d);
> s->pcihost = pcihost;
> @@ -726,9 +723,9 @@ static const TypeInfo bonito_info = {
>
> static void bonito_pcihost_class_init(ObjectClass *klass, void *data)
> {
> - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
> + DeviceClass *dc = DEVICE_CLASS(klass);
>
> - k->init = bonito_pcihost_initfn;
> + dc->realize = bonito_pcihost_realize;
> }
>
> static const TypeInfo bonito_pcihost_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 05/45] trace-events: Fix copy/paste typo, (continued)
- [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
- [Qemu-ppc] [PULL 10/45] hw/pci-host/bonito: Use DeviceState::realize rather than SysBusDevice::init, Eduardo Habkost, 2018/10/18
- Re: [Qemu-ppc] [PULL 10/45] hw/pci-host/bonito: Use DeviceState::realize rather than SysBusDevice::init,
David Gibson <=
- [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
- [Qemu-ppc] [PULL 16/45] hw/mips/malta: Remove unuseful code, Eduardo Habkost, 2018/10/18