diff options
author | Mao Zhongyi <maozhongyi@cmss.chinamobile.com> | 2018-12-13 13:48:00 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-12-13 13:48:00 +0000 |
commit | 9b27555af195e02f9b5a6b5fca31d2a7e0fe1203 (patch) | |
tree | af1ce54b10fbba61e596e68df690c12f4d653af3 /hw/pci-bridge | |
parent | 296097f7dd27aca4b24e0699efb6379c0eb6ff40 (diff) | |
download | qemu-9b27555af195e02f9b5a6b5fca31d2a7e0fe1203.zip qemu-9b27555af195e02f9b5a6b5fca31d2a7e0fe1203.tar.gz qemu-9b27555af195e02f9b5a6b5fca31d2a7e0fe1203.tar.bz2 |
pci-bridge/dec: Convert sysbus init function to realize function
Use DeviceClass rather than SysBusDeviceClass in
pci_dec_21154_device_class_init().
Cc: david@gibson.dropbear.id.au
Cc: mst@redhat.com
Cc: marcel.apfelbaum@gmail.com
Cc: qemu-ppc@nongnu.org
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Message-id: 20181130093852.20739-16-maozhongyi@cmss.chinamobile.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/pci-bridge')
-rw-r--r-- | hw/pci-bridge/dec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c index 84492d5..8484bfd 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 = { |