aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/pci.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index aab57b4abe7f..f2a5946ea0bf 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -477,6 +477,19 @@ static inline bool pci_is_root_bus(struct pci_bus *pbus)
477 return !(pbus->parent); 477 return !(pbus->parent);
478} 478}
479 479
480/**
481 * pci_is_bridge - check if the PCI device is a bridge
482 * @dev: PCI device
483 *
484 * Return true if the PCI device is bridge whether it has subordinate
485 * or not.
486 */
487static inline bool pci_is_bridge(struct pci_dev *dev)
488{
489 return dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
490 dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
491}
492
480static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev) 493static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev)
481{ 494{
482 dev = pci_physfn(dev); 495 dev = pci_physfn(dev);