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>
This commit is contained in:
Heiner Kallweit
2019-04-24 21:11:58 +02:00
committed by Bjorn Helgaas
parent e0547c81bf
commit 4e544bac82
3 changed files with 11 additions and 10 deletions

View File

@@ -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