aboutsummaryrefslogtreecommitdiff
path: root/kernel/irq
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-12-10 20:25:39 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-12-15 16:19:30 +0100
commitf1c6306c0d6b50844ba02c8a53e35405e9c0db05 (patch)
treebfc1a58eafe6bd3d2d32d501f8d5eee94bee8a2b /kernel/irq
parentfdd029630434b434b127efc7fba337da28f45658 (diff)
downloadlinux-stericsson-f1c6306c0d6b50844ba02c8a53e35405e9c0db05.tar.gz
genirq: Move irq_set_lockdep_class() to core
irq_set_lockdep_class() is used from modules and requires irq_to_desc() to be exported. Move it into the core code which lifts another requirement for the export. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20201210194042.860029489@linutronix.de
Diffstat (limited to 'kernel/irq')
-rw-r--r--kernel/irq/irqdesc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index e810eb9906ea..20a54fa7cd30 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -968,3 +968,17 @@ unsigned int kstat_irqs_usr(unsigned int irq)
rcu_read_unlock();
return sum;
}
+
+#ifdef CONFIG_LOCKDEP
+void __irq_set_lockdep_class(unsigned int irq, struct lock_class_key *lock_class,
+ struct lock_class_key *request_class)
+{
+ struct irq_desc *desc = irq_to_desc(irq);
+
+ if (desc) {
+ lockdep_set_class(&desc->lock, lock_class);
+ lockdep_set_class(&desc->request_mutex, request_class);
+ }
+}
+EXPORT_SYMBOL_GPL(__irq_set_lockdep_class);
+#endif