mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
iio:chemical:scd30: Use IRQF_NO_AUTOEN to avoid irq request then disable
This new flag cleanly avoids the need for a dance where we request the interrupt only to immediately disabling it by ensuring it is not auto-enabled in the first place. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Tomasz Duszynski <tomasz.duszynski@octakon.com> Reviewed-by: Barry Song <song.bao.hua@hisilicon.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-6-jic23@kernel.org
This commit is contained in:
parent
ff2293ea9c
commit
dbb8f20d83
1 changed files with 8 additions and 8 deletions
|
@ -655,19 +655,19 @@ static int scd30_setup_trigger(struct iio_dev *indio_dev)
|
||||||
|
|
||||||
indio_dev->trig = iio_trigger_get(trig);
|
indio_dev->trig = iio_trigger_get(trig);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Interrupt is enabled just before taking a fresh measurement
|
||||||
|
* and disabled afterwards. This means we need to ensure it is not
|
||||||
|
* enabled here to keep calls to enable/disable balanced.
|
||||||
|
*/
|
||||||
ret = devm_request_threaded_irq(dev, state->irq, scd30_irq_handler,
|
ret = devm_request_threaded_irq(dev, state->irq, scd30_irq_handler,
|
||||||
scd30_irq_thread_handler, IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
|
scd30_irq_thread_handler,
|
||||||
|
IRQF_TRIGGER_HIGH | IRQF_ONESHOT |
|
||||||
|
IRQF_NO_AUTOEN,
|
||||||
indio_dev->name, indio_dev);
|
indio_dev->name, indio_dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
dev_err(dev, "failed to request irq\n");
|
dev_err(dev, "failed to request irq\n");
|
||||||
|
|
||||||
/*
|
|
||||||
* Interrupt is enabled just before taking a fresh measurement
|
|
||||||
* and disabled afterwards. This means we need to disable it here
|
|
||||||
* to keep calls to enable/disable balanced.
|
|
||||||
*/
|
|
||||||
disable_irq(state->irq);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue