Skip to content

Commit f40b140

Browse files
ardbiesheuvelgregkh
authored andcommitted
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>
1 parent 8c0ef7b commit f40b140

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/misc/lis3lv02d/lis3lv02d.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,10 +1230,12 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
12301230
else
12311231
thread_fn = NULL;
12321232

1233+
if (thread_fn)
1234+
irq_flags |= IRQF_ONESHOT;
1235+
12331236
err = request_threaded_irq(lis3->irq, lis302dl_interrupt,
12341237
thread_fn,
1235-
IRQF_TRIGGER_RISING | IRQF_ONESHOT |
1236-
irq_flags,
1238+
irq_flags | IRQF_TRIGGER_RISING,
12371239
DRIVER_NAME, lis3);
12381240

12391241
if (err < 0) {

0 commit comments

Comments
 (0)