Skip to content

Commit 1b74444

Browse files
committed
genirq/manage: Rework __disable_irq_nosync()
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 55ac0ad commit 1b74444

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

kernel/irq/manage.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -659,14 +659,11 @@ void __disable_irq(struct irq_desc *desc)
659659

660660
static int __disable_irq_nosync(unsigned int irq)
661661
{
662-
unsigned long flags;
663-
struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
664-
665-
if (!desc)
666-
return -EINVAL;
667-
__disable_irq(desc);
668-
irq_put_desc_busunlock(desc, flags);
669-
return 0;
662+
scoped_irqdesc_get_and_lock(irq, IRQ_GET_DESC_CHECK_GLOBAL) {
663+
__disable_irq(scoped_irqdesc);
664+
return 0;
665+
}
666+
return -EINVAL;
670667
}
671668

672669
/**

0 commit comments

Comments
 (0)