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:

gecommit door
Bjorn Helgaas

bovenliggende
e0547c81bf
commit
4e544bac82
@@ -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;
|
||||
}
|
||||
|
Verwijs in nieuw issue
Block a user