summaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorKenji Kaneshige2009-11-11 06:35:22 +0100
committerJesse Barnes2009-11-25 00:25:16 +0100
commit7eb776c42e75d17bd8107a1359068d8c742639d1 (patch)
treeeddee4ecffebc2ac54c1eee548802367c5f17c68 /include/linux/pci.h
parentpciehp: use pci_pcie_cap() (diff)
downloadkernel-qcow2-linux-7eb776c42e75d17bd8107a1359068d8c742639d1.tar.gz
kernel-qcow2-linux-7eb776c42e75d17bd8107a1359068d8c742639d1.tar.xz
kernel-qcow2-linux-7eb776c42e75d17bd8107a1359068d8c742639d1.zip
PCI: introduce pci_is_pcie()
Introduce pci_is_pcie() which returns true if the specified PCI device is PCI Express capable, false otherwise. The purpose of pci_is_pcie() is removing 'is_pcie' flag in the struct pci_dev, which is not needed because we can check it using 'pcie_cap' field. To remove 'is_pcie', we need to update user of 'is_pcie' to use pci_is_pcie() instead first. Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 15f37f102dd3..2891c3d3e51a 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1317,5 +1317,16 @@ static inline int pci_pcie_cap(struct pci_dev *dev)
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 */