summaryrefslogtreecommitdiffstats
path: root/hw/pci-host/versatile.c
diff options
context:
space:
mode:
authorDavid Gibson2017-11-29 09:46:27 +0100
committerMichael S. Tsirkin2017-12-05 18:13:45 +0100
commitfd56e0612b6454a282fa6a953fdb09281a98c589 (patch)
tree28a829abaa964f8ed4834c2ed10441e2878ad2c8 /hw/pci-host/versatile.c
parentpci: Add pci_dev_bus_num() helper (diff)
downloadqemu-fd56e0612b6454a282fa6a953fdb09281a98c589.tar.gz
qemu-fd56e0612b6454a282fa6a953fdb09281a98c589.tar.xz
qemu-fd56e0612b6454a282fa6a953fdb09281a98c589.zip
pci: Eliminate redundant PCIDevice::bus pointer
The bus pointer in PCIDevice is basically redundant with QOM information. It's always initialized to the qdev_get_parent_bus(), the only difference is the type. Therefore this patch eliminates the field, instead creating a pci_get_bus() helper to do the type mangling to derive it conveniently from the QOM Device object underneath. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'hw/pci-host/versatile.c')
-rw-r--r--hw/pci-host/versatile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c
index 8803ada925..d0b02bdc47 100644
--- a/hw/pci-host/versatile.c
+++ b/hw/pci-host/versatile.c
@@ -311,7 +311,7 @@ static const MemoryRegionOps pci_vpb_config_ops = {
static int pci_vpb_map_irq(PCIDevice *d, int irq_num)
{
- PCIVPBState *s = container_of(d->bus, PCIVPBState, pci_bus);
+ PCIVPBState *s = container_of(pci_get_bus(d), PCIVPBState, pci_bus);
if (s->irq_mapping == PCI_VPB_IRQMAP_BROKEN) {
/* Legacy broken IRQ mapping for compatibility with old and