diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2019-04-24 21:11:58 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2019-04-29 16:12:05 -0500 |
commit | 4e544bac8267f65a0bf06aed1bde9964da4812ed (patch) | |
tree | 797279047b61cd10ab8d3cbd59c2a1025a55166e /drivers/pci/search.c | |
parent | e0547c81bfcfad01cbbfa93a5e66bb98ab932f80 (diff) | |
download | lwn-4e544bac8267f65a0bf06aed1bde9964da4812ed.tar.gz lwn-4e544bac8267f65a0bf06aed1bde9964da4812ed.zip |
PCI: Add pci_dev_id() helper
In several places in the kernel we find PCI_DEVID used like this:
PCI_DEVID(dev->bus->number, dev->devfn)
Add a "pci_dev_id(struct pci_dev *dev)" helper to simplify callers.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/search.c')
-rw-r--r-- | drivers/pci/search.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/pci/search.c b/drivers/pci/search.c index 2b5f720862d3..5c7922612733 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c @@ -33,7 +33,7 @@ int pci_for_each_dma_alias(struct pci_dev *pdev, struct pci_bus *bus; int ret; - ret = fn(pdev, PCI_DEVID(pdev->bus->number, pdev->devfn), data); + ret = fn(pdev, pci_dev_id(pdev), data); if (ret) return ret; @@ -88,9 +88,7 @@ int pci_for_each_dma_alias(struct pci_dev *pdev, return ret; continue; case PCI_EXP_TYPE_PCIE_BRIDGE: - ret = fn(tmp, - PCI_DEVID(tmp->bus->number, - tmp->devfn), data); + ret = fn(tmp, pci_dev_id(tmp), data); if (ret) return ret; continue; @@ -101,9 +99,7 @@ int pci_for_each_dma_alias(struct pci_dev *pdev, PCI_DEVID(tmp->subordinate->number, PCI_DEVFN(0, 0)), data); else - ret = fn(tmp, - PCI_DEVID(tmp->bus->number, - tmp->devfn), data); + ret = fn(tmp, pci_dev_id(tmp), data); if (ret) return ret; } |