From: Thomas Gleixner Date: Tue, 29 Apr 2025 06:55:43 +0000 (+0200) Subject: genirq/manage: Rework irq_set_parent() X-Git-Tag: v6.16-rc1~189^2~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90140d08ac7a1e1ea3136132e1fab9baec174c25;p=thirdparty%2Fkernel%2Flinux.git 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 Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/20250429065422.258216558@linutronix.de --- diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index b6f057a6b8ae4..a08bbada83eac 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -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