]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
genirq/manage: Rework irq_set_parent()
authorThomas Gleixner <tglx@linutronix.de>
Tue, 29 Apr 2025 06:55:43 +0000 (08:55 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 7 May 2025 07:08:15 +0000 (09:08 +0200)
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
kernel/irq/manage.c

index b6f057a6b8ae42e1496eb0af7b2d9a931042e8a6..a08bbada83eac8192b6729f4f306a0e2d81e7ece 100644 (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