Use the pci_physfn() helper rather than looking up physfn by hand.
No functional change.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
int pci_enable_ats(struct pci_dev *dev, int ps)
{
u16 ctrl;
+ struct pci_dev *pdev;
BUG_ON(dev->ats_cap && dev->ats_enabled);
*/
ctrl = PCI_ATS_CTRL_ENABLE;
if (dev->is_virtfn) {
- struct pci_dev *pdev = dev->physfn;
-
+ pdev = pci_physfn(dev);
if (pdev->ats_stu != ps)
return -EINVAL;
*/
void pci_disable_ats(struct pci_dev *dev)
{
+ struct pci_dev *pdev;
u16 ctrl;
BUG_ON(!dev->ats_cap || !dev->ats_enabled);
return; /* VFs still enabled */
if (dev->is_virtfn) {
- struct pci_dev *pdev = dev->physfn;
-
+ pdev = pci_physfn(dev);
atomic_dec(&pdev->ats_ref_cnt);
}