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

iio:adc:ad_sigma_delta: Use IRQF_NO_AUTOEN rather than request and disable

These devices are not able to mask the signal used as a data ready
interrupt. As such they previously requested the irq then immediately
disabled it. Now we can avoid the potential of a spurious interrupt
by avoiding the irq being auto enabled in the first place.

I'm not sure how this code could have been called with the irq already
disabled, so I believe the conditional would always have been true and
have removed it.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Alexandru Ardelean <ardeleanalex@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210402184544.488862-8-jic23@kernel.org

+2 -5
+2 -5
drivers/iio/adc/ad_sigma_delta.c
··· 485 485 sigma_delta->trig->ops = &ad_sd_trigger_ops; 486 486 init_completion(&sigma_delta->completion); 487 487 488 + sigma_delta->irq_dis = true; 488 489 ret = request_irq(sigma_delta->spi->irq, 489 490 ad_sd_data_rdy_trig_poll, 490 - sigma_delta->info->irq_flags, 491 + sigma_delta->info->irq_flags | IRQF_NO_AUTOEN, 491 492 indio_dev->name, 492 493 sigma_delta); 493 494 if (ret) 494 495 goto error_free_trig; 495 496 496 - if (!sigma_delta->irq_dis) { 497 - sigma_delta->irq_dis = true; 498 - disable_irq_nosync(sigma_delta->spi->irq); 499 - } 500 497 iio_trigger_set_drvdata(sigma_delta->trig, sigma_delta); 501 498 502 499 ret = iio_trigger_register(sigma_delta->trig);