pci: Use helper to find device's root bus in pci_find_domain()
commitc473d18da1b73301c580115e527207b73dcd597f
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 6 Jun 2013 08:48:48 +0000 (6 18:48 +1000)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 7 Jul 2013 20:10:57 +0000 (7 23:10 +0300)
treeb38fd6fc17cfba6c05754543c9dd08c086dbcff8
parent1ef7a2a2afedbba47e06af5081a8b4bf6dc1cf71
pci: Use helper to find device's root bus in pci_find_domain()

Currently pci_find_domain() performs two functions - it locates the PCI
root bus above the given bus, then looks up that root bus's domain number.
This patch adds a helper function to perform the first task, finding the
root bus for a given PCI device.  This is then used in pci_find_domain().
This changes pci_find_domain()'s signature slightly, taking a PCIDevice
instead of a PCIBus - since all callers passed something of the form
dev->bus, this simplifies things slightly.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pci-hotplug-old.c
hw/pci/pci.c
hw/pci/pcie_aer.c
include/hw/pci/pci.h