summaryrefslogtreecommitdiff
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-12-10 22:25:37 +0300
committerThomas Gleixner <tglx@linutronix.de>2020-12-15 18:19:30 +0300
commita313357e704f2617f298333e3e617a38b1719760 (patch)
tree8892748e6d35f6d6aa0a60fbc6fac6930ca5083b /kernel/irq/manage.c
parent3c41e57a1e168d879e923c5583adeae47eec9f64 (diff)
downloadlinux-a313357e704f2617f298333e3e617a38b1719760.tar.xz
genirq: Move irq_has_action() into core code
This function uses irq_to_desc() and is going to be used by modules to replace the open coded irq_to_desc() (ab)usage. The final goal is to remove the export of irq_to_desc() so driver cannot fiddle with it anymore. Move it into the core code and fixup the usage sites to include the proper header. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20201210194042.548936472@linutronix.de
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index c826ba4141fe..a5a1cde5c1a2 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -2822,3 +2822,20 @@ out_unlock:
return err;
}
EXPORT_SYMBOL_GPL(irq_set_irqchip_state);
+
+/**
+ * irq_has_action - Check whether an interrupt is requested
+ * @irq: The linux irq number
+ *
+ * Returns: A snapshot of the current state
+ */
+bool irq_has_action(unsigned int irq)
+{
+ bool res;
+
+ rcu_read_lock();
+ res = irq_desc_has_action(irq_to_desc(irq));
+ rcu_read_unlock();
+ return res;
+}
+EXPORT_SYMBOL_GPL(irq_has_action);