summaryrefslogtreecommitdiff
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2019-04-24 21:11:58 +0200
committerBjorn Helgaas <bhelgaas@google.com>2019-04-29 16:12:05 -0500
commit4e544bac8267f65a0bf06aed1bde9964da4812ed (patch)
tree797279047b61cd10ab8d3cbd59c2a1025a55166e /include/linux/pci.h
parente0547c81bfcfad01cbbfa93a5e66bb98ab932f80 (diff)
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 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5f32275358cf..26fa6d143dfe 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -596,6 +596,11 @@ struct pci_bus {
#define to_pci_bus(n) container_of(n, struct pci_bus, dev)
+static inline u16 pci_dev_id(struct pci_dev *dev)
+{
+ return PCI_DEVID(dev->bus->number, dev->devfn);
+}
+
/*
* Returns true if the PCI bus is root (behind host-PCI bridge),
* false otherwise