summaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2015-06-10 16:55:00 +0800
committerBjorn Helgaas <bhelgaas@google.com>2015-07-30 14:13:20 -0500
commit811a4e6fce09bc9239c664c6a1a53645a678c303 (patch)
tree069115c57617ebe535f923e8c6b1b4c1fbe28492 /include/linux/pci.h
parent991de2e59090e55c65a7f59a049142e3c480f7bd (diff)
downloadop-kernel-dev-811a4e6fce09bc9239c664c6a1a53645a678c303.zip
op-kernel-dev-811a4e6fce09bc9239c664c6a1a53645a678c303.tar.gz
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.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index b4832c9..b7ab0c4 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;
OpenPOWER on IntegriCloud