Skip to content

Commit 27004f8

Browse files
Shixiong Ouawilliam
authored andcommitted
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: Shixiong Ou <[email protected]> Reviewed-by: Brett Creeley <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
1 parent 5a59f2f commit 27004f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/vfio/pci/pds/vfio_dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static int pds_vfio_init_device(struct vfio_device *vdev)
162162
pci_id = PCI_DEVID(pdev->bus->number, pdev->devfn);
163163
dev_dbg(&pdev->dev,
164164
"%s: PF %#04x VF %#04x vf_id %d domain %d pds_vfio %p\n",
165-
__func__, pci_dev_id(pdev->physfn), pci_id, vf_id,
165+
__func__, pci_dev_id(pci_physfn(pdev)), pci_id, vf_id,
166166
pci_domain_nr(pdev->bus), pds_vfio);
167167

168168
return 0;

0 commit comments

Comments
 (0)