linux/interrupt.h: allow "guard" notation to disable and reenable IRQ
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 30 May 2024 18:07:19 +0000 (11:07 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 6 Jun 2024 21:35:01 +0000 (14:35 -0700)
commitc76494768761aef7630e7e0db820ba7b375964da
tree392ca942ec8ee4f1cd3389b4e967a87d80ec7077
parenta38297e3fb012ddfa7ce0321a7e5a8daeb1872b6
linux/interrupt.h: allow "guard" notation to disable and reenable IRQ

Drivers often need to first disable an interrupt, carry out some
action, and then reenable the interrupt. Introduce support for the
"guard" notation for this so that the following is possible:

...

scoped_cond_guard(mutex_intr, return -EINTR, &data->sysfs_mutex) {
guard(disable_irq)(&client->irq);

error = elan_acquire_baseline(data);
if (error)
return error;
}

...

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/ZljAV6HjkPSEhWSw@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
include/linux/interrupt.h