[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH v3 15/21] pci-bridge/dec: Convert sys
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH v3 15/21] pci-bridge/dec: Convert sysbus init function to realize function |
Date: |
Fri, 30 Nov 2018 13:02:37 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
On 30/11/18 10:38, Mao Zhongyi wrote:
> Use DeviceClass rather than SysBusDeviceClass in
> pci_dec_21154_device_class_init().
>
> Cc: address@hidden
> Cc: address@hidden
> Cc: address@hidden
> Cc: address@hidden
>
> Signed-off-by: Mao Zhongyi <address@hidden>
> Signed-off-by: Zhang Shengju <address@hidden>
> Reviewed-by: David Gibson <address@hidden>
> Acked-by: David Gibson <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> hw/pci-bridge/dec.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c
> index 84492d5e5f..8484bfd434 100644
> --- a/hw/pci-bridge/dec.c
> +++ b/hw/pci-bridge/dec.c
> @@ -98,9 +98,10 @@ PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
> return pci_bridge_get_sec_bus(br);
> }
>
> -static int pci_dec_21154_device_init(SysBusDevice *dev)
> +static void pci_dec_21154_device_realize(DeviceState *dev, Error **errp)
> {
> PCIHostState *phb;
> + SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
>
> phb = PCI_HOST_BRIDGE(dev);
>
> @@ -108,9 +109,8 @@ static int pci_dec_21154_device_init(SysBusDevice *dev)
> dev, "pci-conf-idx", 0x1000);
> memory_region_init_io(&phb->data_mem, OBJECT(dev), &pci_host_data_le_ops,
> dev, "pci-data-idx", 0x1000);
> - sysbus_init_mmio(dev, &phb->conf_mem);
> - sysbus_init_mmio(dev, &phb->data_mem);
> - return 0;
> + sysbus_init_mmio(sbd, &phb->conf_mem);
> + sysbus_init_mmio(sbd, &phb->data_mem);
> }
>
> static void dec_21154_pci_host_realize(PCIDevice *d, Error **errp)
> @@ -150,9 +150,9 @@ static const TypeInfo dec_21154_pci_host_info = {
>
> static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data)
> {
> - SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
> + DeviceClass *dc = DEVICE_CLASS(klass);
>
> - sdc->init = pci_dec_21154_device_init;
> + dc->realize = pci_dec_21154_device_realize;
> }
>
> static const TypeInfo pci_dec_21154_device_info = {
>