Commit 27004f89 authored by Shixiong Ou's avatar Shixiong Ou Committed by Alex Williamson
Browse files

vfio/pds: Use proper PF device access helper



The pci_physfn() helper exists to support cases where the physfn
field may not be compiled into the pci_dev structure. We've
declared this driver dependent on PCI_IOV to avoid this problem,
but regardless we should follow the precedent not to access this
field directly.

Signed-off-by: default avatarShixiong Ou <oushixiong@kylinos.cn>
Reviewed-by: default avatarBrett Creeley <brett.creeley@amd.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20230914021332.1929155-1-oushixiong@kylinos.cn


Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 5a59f2ff
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@ static int pds_vfio_init_device(struct vfio_device *vdev)
	pci_id = PCI_DEVID(pdev->bus->number, pdev->devfn);
	dev_dbg(&pdev->dev,
		"%s: PF %#04x VF %#04x vf_id %d domain %d pds_vfio %p\n",
		__func__, pci_dev_id(pdev->physfn), pci_id, vf_id,
		__func__, pci_dev_id(pci_physfn(pdev)), pci_id, vf_id,
		pci_domain_nr(pdev->bus), pds_vfio);

	return 0;