Commit f1c6306c authored by Thomas Gleixner's avatar Thomas Gleixner

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: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20201210194042.860029489@linutronix.de
parent fdd02963
...@@ -240,16 +240,14 @@ static inline bool irq_is_percpu_devid(unsigned int irq) ...@@ -240,16 +240,14 @@ static inline bool irq_is_percpu_devid(unsigned int irq)
return irq_check_status_bit(irq, IRQ_PER_CPU_DEVID); return irq_check_status_bit(irq, IRQ_PER_CPU_DEVID);
} }
void __irq_set_lockdep_class(unsigned int irq, struct lock_class_key *lock_class,
struct lock_class_key *request_class);
static inline void static inline void
irq_set_lockdep_class(unsigned int irq, struct lock_class_key *lock_class, irq_set_lockdep_class(unsigned int irq, struct lock_class_key *lock_class,
struct lock_class_key *request_class) struct lock_class_key *request_class)
{ {
struct irq_desc *desc = irq_to_desc(irq); if (IS_ENABLED(CONFIG_LOCKDEP))
__irq_set_lockdep_class(irq, lock_class, request_class);
if (desc) {
lockdep_set_class(&desc->lock, lock_class);
lockdep_set_class(&desc->request_mutex, request_class);
}
} }
#endif #endif
...@@ -968,3 +968,17 @@ unsigned int kstat_irqs_usr(unsigned int irq) ...@@ -968,3 +968,17 @@ unsigned int kstat_irqs_usr(unsigned int irq)
rcu_read_unlock(); rcu_read_unlock();
return sum; 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment