Skip to content

Commit 90140d0

Browse files
committed
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 <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent a1ceb83 commit 90140d0

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

kernel/irq/manage.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -959,16 +959,11 @@ int __irq_set_trigger(struct irq_desc *desc, unsigned long flags)
959959
#ifdef CONFIG_HARDIRQS_SW_RESEND
960960
int irq_set_parent(int irq, int parent_irq)
961961
{
962-
unsigned long flags;
963-
struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
964-
965-
if (!desc)
966-
return -EINVAL;
967-
968-
desc->parent_irq = parent_irq;
969-
970-
irq_put_desc_unlock(desc, flags);
971-
return 0;
962+
scoped_irqdesc_get_and_lock(irq, 0) {
963+
scoped_irqdesc->parent_irq = parent_irq;
964+
return 0;
965+
}
966+
return -EINVAL;
972967
}
973968
EXPORT_SYMBOL_GPL(irq_set_parent);
974969
#endif

0 commit comments

Comments
 (0)