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.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -596,6 +596,11 @@ struct pci_bus { · 595 unmodified lines | |||
| 596 | 596 | ||
| 597 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) | 597 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) |
| 598 | 598 | ||
| 599 | static inline u16 pci_dev_id(struct pci_dev *dev) | ||
| 600 | { | ||
| 601 | return PCI_DEVID(dev->bus->number, dev->devfn); | ||
| 602 | } | ||
| 603 | |||
| 599 | /* | 604 | /* |
| 600 | * Returns true if the PCI bus is root (behind host-PCI bridge), | 605 | * Returns true if the PCI bus is root (behind host-PCI bridge), |
| 601 | * false otherwise | 606 | * false otherwise |