From: Ethan Zhao Date: Tue, 9 Sep 2014 02:21:25 +0000 (+0800) Subject: PCI: Add device flag helper functions X-Git-Tag: v3.18-rc1~110^2~13^4~3 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=ce0529843a505d09f5809a7db6288d2f038f64c4;p=linux.git PCI: Add device flag helper functions 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 Signed-off-by: Bjorn Helgaas --- diff --git a/include/linux/pci.h b/include/linux/pci.h index 61978a460841..92c131efec1c 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -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 */