Commit f40b1401 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Greg Kroah-Hartman
Browse files

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: default avatarArd Biesheuvel <ardb@kernel.org>
Link: https://patch.msgid.link/20260326180436.14968-2-ardb@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8c0ef7b5
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1230,10 +1230,12 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
	else
		thread_fn = NULL;

	if (thread_fn)
		irq_flags |= IRQF_ONESHOT;

	err = request_threaded_irq(lis3->irq, lis302dl_interrupt,
				thread_fn,
				IRQF_TRIGGER_RISING | IRQF_ONESHOT |
				irq_flags,
				irq_flags | IRQF_TRIGGER_RISING,
				DRIVER_NAME, lis3);

	if (err < 0) {