linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] PCI: Refactor pci_is_bridge()
@ 2014-03-14  9:38 Yijing Wang
  2014-04-04 23:32 ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Yijing Wang @ 2014-03-14  9:38 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, Rafael J. Wysocki, Yijing Wang

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

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 include/linux/pci.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 33aa2ca..22370c4 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -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
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-08  9:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14  9:38 [PATCH 2/2] PCI: Refactor pci_is_bridge() Yijing Wang
2014-04-04 23:32 ` Bjorn Helgaas
2014-04-08  9:26   ` Yijing Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).