Skip to contentSkip to conversation

PCI: Refactor pci_is_bridge()

PATCH In review Yijing Wang 1 participant 1 message Mar 14, 2014 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 PCI: Refactor pci_is_bridge()

Refactor pci_is_bridge(), check pci device hdr_type instead, and move it in include/linux/pci.h

---
 include/linux/pci.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
include/linux/pci.h +6 -0
index 33aa2ca..22370c4 100644
@@ -1649,6 +1649,12 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
 	return pci_pcie_cap(dev);
 }
 
+static inline bool pci_is_bridge(struct pci_dev *dev)
+{
+	return dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
+		dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
+}
+
 /**
  * pcie_caps_reg - get the PCIe Capabilities Register
  * @dev: PCI device
Signature · 1 line
1.7.1