diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2011-01-27 15:56:36 +0900 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2011-03-28 18:34:22 +0200 |
commit | 5256d8bfad9b0113dc2f9b57706eaad26b008987 (patch) | |
tree | 8bb9ff38185905500774ea5040e5de1537e36f28 /hw/pci-hotplug.c | |
parent | 90a20dbb2837f5ff05a9b19659ba1aa218cbd2de (diff) |
pci: use devfn for pci_find_device() instead of (slot, fn) pair
(slot, fn) pair is somewhat confusing because of ARI.
So use devfn for pci_find_device() instead of (slot, fn).
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci-hotplug.c')
-rw-r--r-- | hw/pci-hotplug.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index 478fe9b836..b59be2a599 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -127,7 +127,8 @@ void drive_hot_add(Monitor *mon, const QDict *qdict) if (pci_read_devaddr(mon, pci_addr, &dom, &pci_bus, &slot)) { goto err; } - dev = pci_find_device(pci_find_root_bus(dom), pci_bus, slot, 0); + dev = pci_find_device(pci_find_root_bus(dom), pci_bus, + PCI_DEVFN(slot, 0)); if (!dev) { monitor_printf(mon, "no pci device with address %s\n", pci_addr); goto err; @@ -277,7 +278,7 @@ static int pci_device_hot_remove(Monitor *mon, const char *pci_addr) return -1; } - d = pci_find_device(pci_find_root_bus(dom), bus, slot, 0); + d = pci_find_device(pci_find_root_bus(dom), bus, PCI_DEVFN(slot, 0)); if (!d) { monitor_printf(mon, "slot %d empty\n", slot); return -1; |