Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lis3lv02d: Omit IRQF_ONESHOT if no threaded handler is provided

The lis3lv02d started triggering a WARN in the IRQ code because it
passes IRQF_ONESHOT to request_threaded_irq() even when thread_fn is
NULL, which is an invalid combination.

So set the flag only if thread_fn is non-NULL.

Cc: Eric Piel <eric.piel@tremplin-utc.net>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://patch.msgid.link/20260326180436.14968-2-ardb@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ard Biesheuvel and committed by
Greg Kroah-Hartman
f40b1401 8c0ef7b5

+4 -2
+4 -2
drivers/misc/lis3lv02d/lis3lv02d.c
··· 1230 1230 else 1231 1231 thread_fn = NULL; 1232 1232 1233 + if (thread_fn) 1234 + irq_flags |= IRQF_ONESHOT; 1235 + 1233 1236 err = request_threaded_irq(lis3->irq, lis302dl_interrupt, 1234 1237 thread_fn, 1235 - IRQF_TRIGGER_RISING | IRQF_ONESHOT | 1236 - irq_flags, 1238 + irq_flags | IRQF_TRIGGER_RISING, 1237 1239 DRIVER_NAME, lis3); 1238 1240 1239 1241 if (err < 0) {