aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCai Huoqing <caihuoqing@baidu.com>2021-07-13 09:48:31 +0800
committerAlex Williamson <alex.williamson@redhat.com>2021-07-14 13:47:17 -0600
commit936555bc4f9efce1a9d35466845169c2c7566794 (patch)
treea743f4a3eb8aeb7436e5dcbf33a0c9f7ae819ce9
parenta5dba9bc0552785b91315d457b9397ebd833224b (diff)
vfio/pci: Change to use vfio_pci_is()
Make use of vfio_pci_is() helper function. Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210713014831.742-1-caihuoqing@baidu.com [aw: commit log wording] Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
-rw-r--r--hw/vfio/pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index ab4077aad2..971273fd45 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3058,14 +3058,14 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
}
}
- if (vdev->vendor_id == PCI_VENDOR_ID_NVIDIA) {
+ if (vfio_pci_is(vdev, PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID)) {
ret = vfio_pci_nvidia_v100_ram_init(vdev, errp);
if (ret && ret != -ENODEV) {
error_report("Failed to setup NVIDIA V100 GPU RAM");
}
}
- if (vdev->vendor_id == PCI_VENDOR_ID_IBM) {
+ if (vfio_pci_is(vdev, PCI_VENDOR_ID_IBM, PCI_ANY_ID)) {
ret = vfio_pci_nvlink2_init(vdev, errp);
if (ret && ret != -ENODEV) {
error_report("Failed to setup NVlink2 bridge");