Skip to content

Commit

Permalink
PCI: introduce pci_is_pcie()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kenji Kaneshige authored and Jesse Barnes committed Nov 24, 2009
1 parent 1518c17 commit 7eb776c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 7eb776c

Please sign in to comment.