diff options
author | Andreas Färber <afaerber@suse.de> | 2014-04-24 17:26:51 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-05-21 15:47:50 +0300 |
commit | 7c8b7248261bfa5e54eff1715b699caa8b3f1d77 (patch) | |
tree | 63022ed65beacd587d5d14e685f3a971fc5ffa4c /hw/pci | |
parent | 0d73394ad93aa12755316b3a90b3193aeeb95f90 (diff) | |
download | qemu-7c8b7248261bfa5e54eff1715b699caa8b3f1d77.tar.gz qemu-7c8b7248261bfa5e54eff1715b699caa8b3f1d77.tar.bz2 qemu-7c8b7248261bfa5e54eff1715b699caa8b3f1d77.zip |
pcie_host: Turn pcie_host_init() into an instance_init
This assures the trivial field initialization is applied for any derived
type - currently only Q35PCIHost.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci')
-rw-r--r-- | hw/pci/pcie_host.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/pci/pcie_host.c b/hw/pci/pcie_host.c index c6e1b573e1..7c88a1d091 100644 --- a/hw/pci/pcie_host.c +++ b/hw/pci/pcie_host.c @@ -83,11 +83,11 @@ static const MemoryRegionOps pcie_mmcfg_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -int pcie_host_init(PCIExpressHost *e) +static void pcie_host_init(Object *obj) { - e->base_addr = PCIE_BASE_ADDR_UNMAPPED; + PCIExpressHost *e = PCIE_HOST_BRIDGE(obj); - return 0; + e->base_addr = PCIE_BASE_ADDR_UNMAPPED; } void pcie_host_mmcfg_unmap(PCIExpressHost *e) @@ -128,6 +128,7 @@ static const TypeInfo pcie_host_type_info = { .parent = TYPE_PCI_HOST_BRIDGE, .abstract = true, .instance_size = sizeof(PCIExpressHost), + .instance_init = pcie_host_init, }; static void pcie_host_register_types(void) |