diff mbox

[8/12] PCI: introduce pci_is_pcie()

Message ID 4AFA4D1A.8030107@jp.fujitsu.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Kenji Kaneshige Nov. 11, 2009, 5:35 a.m. UTC
None
diff mbox

Patch

Index: 20091110/include/linux/pci.h
===================================================================
--- 20091110.orig/include/linux/pci.h
+++ 20091110/include/linux/pci.h
@@ -1317,5 +1317,16 @@  static inline int pci_pcie_cap(struct pc
 	return dev->pcie_cap;
 }
 
+/**
+ * pci_is_pcie - check if the PCI device is PCI Express capable
+ * @dev: PCI device
+ *
+ * Retrun true if the PCI device is PCI Express capable, false otherwise.
+ */
+static inline bool pci_is_pcie(struct pci_dev *dev)
+{
+	return !!pci_pcie_cap(dev);
+}
+
 #endif /* __KERNEL__ */
 #endif /* LINUX_PCI_H */