diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2020-12-10 20:25:39 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2020-12-15 16:19:30 +0100 |
commit | f1c6306c0d6b50844ba02c8a53e35405e9c0db05 (patch) | |
tree | bfc1a58eafe6bd3d2d32d501f8d5eee94bee8a2b /include/linux/irqdesc.h | |
parent | fdd029630434b434b127efc7fba337da28f45658 (diff) | |
download | lwn-f1c6306c0d6b50844ba02c8a53e35405e9c0db05.tar.gz lwn-f1c6306c0d6b50844ba02c8a53e35405e9c0db05.zip |
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 'include/linux/irqdesc.h')
-rw-r--r-- | include/linux/irqdesc.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 308d7db8991f..4a1d016716f4 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h @@ -240,16 +240,14 @@ static inline bool irq_is_percpu_devid(unsigned int irq) 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 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); - } + if (IS_ENABLED(CONFIG_LOCKDEP)) + __irq_set_lockdep_class(irq, lock_class, request_class); } #endif |