summaryrefslogtreecommitdiffstats
path: root/kernel/irq
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-12-10 20:25:38 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-12-15 16:19:30 +0100
commitfdd029630434b434b127efc7fba337da28f45658 (patch)
treec8a1c178eb8869422e6d5ee5517a9842dd5bd903 /kernel/irq
parentgenirq: Move irq_has_action() into core code (diff)
downloadlinux-fdd029630434b434b127efc7fba337da28f45658.tar.xz
linux-fdd029630434b434b127efc7fba337da28f45658.zip
genirq: Move status flag checks to core
These checks are used by modules and prevent the removal of the export of irq_to_desc(). Move the accessor into the core. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20201210194042.703779349@linutronix.de
Diffstat (limited to 'kernel/irq')
-rw-r--r--kernel/irq/manage.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index a5a1cde5c1a2..ab8567f32501 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -2839,3 +2839,23 @@ bool irq_has_action(unsigned int irq)
return res;
}
EXPORT_SYMBOL_GPL(irq_has_action);
+
+/**
+ * irq_check_status_bit - Check whether bits in the irq descriptor status are set
+ * @irq: The linux irq number
+ * @bitmask: The bitmask to evaluate
+ *
+ * Returns: True if one of the bits in @bitmask is set
+ */
+bool irq_check_status_bit(unsigned int irq, unsigned int bitmask)
+{
+ struct irq_desc *desc;
+ bool res = false;
+
+ rcu_read_lock();
+ desc = irq_to_desc(irq);
+ if (desc)
+ res = !!(desc->status_use_accessors & bitmask);
+ rcu_read_unlock();
+ return res;
+}