summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2017-11-14 12:11:22 -0600
committerBjorn Helgaas <bhelgaas@google.com>2017-11-14 12:11:22 -0600
commit8d666e53e07ac4562eb8ef73c1904d88522fcb8b (patch)
treed0497b017fb07bf5503c8831c65d6abd5f5d103f /include
parent1a03bac30341dcf98c0d7d181c52edcff7e248c5 (diff)
parentdb63d40017a523d127ec78328fed643918c7c54c (diff)
Merge branch 'pci/hotplug' into next
* pci/hotplug: PCI: pciehp: Do not clear Presence Detect Changed during initialization PCI: pciehp: Fix race condition handling surprise link down PCI: Distribute available resources to hotplug-capable bridges PCI: Distribute available buses to hotplug-capable bridges PCI: Do not allocate more buses than available in parent PCI: Open-code the two pass loop when scanning bridges PCI: Move pci_hp_add_bridge() to drivers/pci/probe.c PCI: Add for_each_pci_bridge() helper PCI: shpchp: Convert timers to use timer_setup() PCI: cpqphp: Convert timers to use timer_setup() PCI: pciehp: Convert timers to use timer_setup() PCI: ibmphp: Use common error handling code in unconfigure_boot_device()
Diffstat (limited to 'include')
-rw-r--r--include/linux/pci.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index f4f8ee5a7362..3dbe947b4152 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -596,6 +596,10 @@ static inline bool pci_is_bridge(struct pci_dev *dev)
dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
}
+#define for_each_pci_bridge(dev, bus) \
+ list_for_each_entry(dev, &bus->devices, bus_list) \
+ if (!pci_is_bridge(dev)) {} else
+
static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev)
{
dev = pci_physfn(dev);