Skip to content

Commit

Permalink
PCI: Add device flag helper functions
Browse files Browse the repository at this point in the history
Add helper functions to hide direct device flag operations:

    void pci_set_dev_assigned(struct pci_dev *dev);
    void pci_clear_dev_assigned(struct pci_dev *dev);
    bool pci_is_dev_assigned(struct pci_dev *dev);

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Ethan Zhao authored and Bjorn Helgaas committed Sep 16, 2014
1 parent 11e4253 commit ce05298
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -1839,4 +1839,17 @@ int pci_for_each_dma_alias(struct pci_dev *pdev,
*/
struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev);

/* helper functions for operation of device flag */
static inline void pci_set_dev_assigned(struct pci_dev *pdev)
{
pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED;
}
static inline void pci_clear_dev_assigned(struct pci_dev *pdev)
{
pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED;
}
static inline bool pci_is_dev_assigned(struct pci_dev *pdev)
{
return (pdev->dev_flags & PCI_DEV_FLAGS_ASSIGNED) == PCI_DEV_FLAGS_ASSIGNED;
}
#endif /* LINUX_PCI_H */

0 comments on commit ce05298

Please sign in to comment.