diff options
-rw-r--r-- | include/linux/pci.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index d3a888ae4b2e..835ec7bf6c05 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -480,6 +480,15 @@ static inline bool pci_is_root_bus(struct pci_bus *pbus) | |||
480 | return !(pbus->parent); | 480 | return !(pbus->parent); |
481 | } | 481 | } |
482 | 482 | ||
483 | static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev) | ||
484 | { | ||
485 | dev = pci_physfn(dev); | ||
486 | if (pci_is_root_bus(dev->bus)) | ||
487 | return NULL; | ||
488 | |||
489 | return dev->bus->self; | ||
490 | } | ||
491 | |||
483 | #ifdef CONFIG_PCI_MSI | 492 | #ifdef CONFIG_PCI_MSI |
484 | static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) | 493 | static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) |
485 | { | 494 | { |