mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
genirq/chip: Rework irq_set_handler_data()
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.415072350@linutronix.de
This commit is contained in:
parent
fa870e0f35
commit
321a0fdf13
|
|
@ -67,22 +67,19 @@ int irq_set_irq_type(unsigned int irq, unsigned int type)
|
|||
EXPORT_SYMBOL(irq_set_irq_type);
|
||||
|
||||
/**
|
||||
* irq_set_handler_data - set irq handler data for an irq
|
||||
* @irq: Interrupt number
|
||||
* @data: Pointer to interrupt specific data
|
||||
* irq_set_handler_data - set irq handler data for an irq
|
||||
* @irq: Interrupt number
|
||||
* @data: Pointer to interrupt specific data
|
||||
*
|
||||
* Set the hardware irq controller data for an irq
|
||||
* Set the hardware irq controller data for an irq
|
||||
*/
|
||||
int irq_set_handler_data(unsigned int irq, void *data)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
|
||||
|
||||
if (!desc)
|
||||
return -EINVAL;
|
||||
desc->irq_common_data.handler_data = data;
|
||||
irq_put_desc_unlock(desc, flags);
|
||||
return 0;
|
||||
scoped_irqdesc_get_and_lock(irq, 0) {
|
||||
scoped_irqdesc->irq_common_data.handler_data = data;
|
||||
return 0;
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL(irq_set_handler_data);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user