aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHeiner Kallweit <[email protected]>2019-04-24 21:11:58 +0200
committerBjorn Helgaas <[email protected]>2019-04-29 16:12:05 -0500
commit4e544bac8267f65a0bf06aed1bde9964da4812ed (patch)
tree797279047b61cd10ab8d3cbd59c2a1025a55166e /include
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 <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
Diffstat (limited to 'include')
-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