Commit 95a36458 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

genirq/chip: Rework irq_modify_status()



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

Fixup the kernel doc comment while at it.

No functional change.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/all/20250429065421.650454052@linutronix.de
parent 5cd05f3e
Loading
Loading
Loading
Loading
+23 −27
Original line number Diff line number Diff line
@@ -972,12 +972,9 @@ EXPORT_SYMBOL_GPL(irq_set_chip_and_handler_name);

void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set)
{
	unsigned long flags, trigger, tmp;
	struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);

	if (!desc)
		return;

	scoped_irqdesc_get_and_lock(irq, 0) {
		struct irq_desc *desc = scoped_irqdesc;
		unsigned long trigger, tmp;
		/*
		 * Warn when a driver sets the no autoenable flag on an already
		 * active interrupt.
@@ -1002,8 +999,7 @@ void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set)
			trigger = tmp;

		irqd_set(&desc->irq_data, trigger);

	irq_put_desc_unlock(desc, flags);
	}
}
EXPORT_SYMBOL_GPL(irq_modify_status);