diff options
author | David Gibson | 2017-11-29 09:46:27 +0100 |
---|---|---|
committer | Michael S. Tsirkin | 2017-12-05 18:13:45 +0100 |
commit | fd56e0612b6454a282fa6a953fdb09281a98c589 (patch) | |
tree | 28a829abaa964f8ed4834c2ed10441e2878ad2c8 /hw/usb/hcd-xhci.c | |
parent | pci: Add pci_dev_bus_num() helper (diff) | |
download | qemu-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/usb/hcd-xhci.c')
-rw-r--r-- | hw/usb/hcd-xhci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index af3a9d88de..228e82b3fb 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3416,7 +3416,7 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp) PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64, &xhci->mem); - if (pci_bus_is_express(dev->bus) || + if (pci_bus_is_express(pci_get_bus(dev)) || xhci_get_flag(xhci, XHCI_FLAG_FORCE_PCIE_ENDCAP)) { ret = pcie_endpoint_cap_init(dev, 0xa0); assert(ret > 0); |