mirror of
https://github.com/torvalds/linux.git
synced 2025-11-05 11:10:22 +02:00
genirq/chip: Rework irq_set_handler() variants
Use the new guards to get and lock the interrupt descriptor and tidy up the code. Fixup the kernel doc comment while at it. No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/all/20250429065421.590753128@linutronix.de
This commit is contained in:
parent
b3801ddc68
commit
5cd05f3e23
1 changed files with 11 additions and 23 deletions
|
|
@ -941,35 +941,23 @@ __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void __irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
|
||||||
__irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
|
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
scoped_irqdesc_get_and_lock(irq, 0)
|
||||||
struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, 0);
|
__irq_do_set_handler(scoped_irqdesc, handle, is_chained, name);
|
||||||
|
|
||||||
if (!desc)
|
|
||||||
return;
|
|
||||||
|
|
||||||
__irq_do_set_handler(desc, handle, is_chained, name);
|
|
||||||
irq_put_desc_busunlock(desc, flags);
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(__irq_set_handler);
|
EXPORT_SYMBOL_GPL(__irq_set_handler);
|
||||||
|
|
||||||
void
|
void irq_set_chained_handler_and_data(unsigned int irq, irq_flow_handler_t handle,
|
||||||
irq_set_chained_handler_and_data(unsigned int irq, irq_flow_handler_t handle,
|
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
scoped_irqdesc_get_and_buslock(irq, 0) {
|
||||||
struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, 0);
|
struct irq_desc *desc = scoped_irqdesc;
|
||||||
|
|
||||||
if (!desc)
|
|
||||||
return;
|
|
||||||
|
|
||||||
desc->irq_common_data.handler_data = data;
|
desc->irq_common_data.handler_data = data;
|
||||||
__irq_do_set_handler(desc, handle, 1, NULL);
|
__irq_do_set_handler(desc, handle, 1, NULL);
|
||||||
|
}
|
||||||
irq_put_desc_busunlock(desc, flags);
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(irq_set_chained_handler_and_data);
|
EXPORT_SYMBOL_GPL(irq_set_chained_handler_and_data);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue