From c473d18da1b73301c580115e527207b73dcd597f Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 6 Jun 2013 18:48:48 +1000 Subject: 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 Signed-off-by: Michael S. Tsirkin --- hw/pci/pci-hotplug-old.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/pci/pci-hotplug-old.c') diff --git a/hw/pci/pci-hotplug-old.c b/hw/pci/pci-hotplug-old.c index 7a47d6b0f0..37e0720513 100644 --- a/hw/pci/pci-hotplug-old.c +++ b/hw/pci/pci-hotplug-old.c @@ -276,7 +276,7 @@ void pci_device_hot_add(Monitor *mon, const QDict *qdict) if (dev) { monitor_printf(mon, "OK domain %d, bus %d, slot %d, function %d\n", - pci_find_domain(dev->bus), + pci_find_domain(dev), pci_bus_num(dev->bus), PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); } else -- cgit v1.2.3-55-g7522