diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2015-06-10 11:55:00 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-07-30 22:13:20 +0300 |
commit | 811a4e6fce09bc9239c664c6a1a53645a678c303 (patch) | |
tree | 069115c57617ebe535f923e8c6b1b4c1fbe28492 /include/linux/pci.h | |
parent | 991de2e59090e55c65a7f59a049142e3c480f7bd (diff) | |
download | linux-811a4e6fce09bc9239c664c6a1a53645a678c303.tar.xz |
PCI: Add helpers to manage pci_dev->irq and pci_dev->irq_managed
Add pci_has_managed_irq(), pci_set_managed_irq(), and
pci_reset_managed_irq() to simplify code. No functional change.
[bhelgaas: changelog]
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index b4832c92f23e..b7ab0c424ed6 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -963,6 +963,23 @@ static inline int pci_is_managed(struct pci_dev *pdev) return pdev->is_managed; } +static inline void pci_set_managed_irq(struct pci_dev *pdev, unsigned int irq) +{ + pdev->irq = irq; + pdev->irq_managed = 1; +} + +static inline void pci_reset_managed_irq(struct pci_dev *pdev) +{ + pdev->irq = 0; + pdev->irq_managed = 0; +} + +static inline bool pci_has_managed_irq(struct pci_dev *pdev) +{ + return pdev->irq_managed && pdev->irq > 0; +} + void pci_disable_device(struct pci_dev *dev); extern unsigned int pcibios_max_latency; |