genirq: Move status flag checks to core
[sfrench/cifs-2.6.git] / kernel / irq / manage.c
index a5a1cde5c1a28d0fcc308d903507aced11f4f23d..ab8567f32501f6e0c2dbab9065fa6946f30bc65e 100644 (file)
@@ -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;
+}