genirq/manage: Rework irq_set_parent()

Use the new guards to get and lock the interrupt descriptor and tidy up the
code.

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/20250429065422.258216558@linutronix.de
pull/1250/head
Thomas Gleixner 2025-04-29 08:55:43 +02:00
parent a1ceb83141
commit 90140d08ac
1 changed files with 5 additions and 10 deletions

View File

@ -959,16 +959,11 @@ int __irq_set_trigger(struct irq_desc *desc, unsigned long flags)
#ifdef CONFIG_HARDIRQS_SW_RESEND
int irq_set_parent(int irq, int parent_irq)
{
unsigned long flags;
struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
if (!desc)
return -EINVAL;
desc->parent_irq = parent_irq;
irq_put_desc_unlock(desc, flags);
return 0;
scoped_irqdesc_get_and_lock(irq, 0) {
scoped_irqdesc->parent_irq = parent_irq;
return 0;
}
return -EINVAL;
}
EXPORT_SYMBOL_GPL(irq_set_parent);
#endif