mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
iio: pressure: rohm-bm1390: harden trigger handler against transient errors
bm1390_trigger_handler() returns from three error paths without calling iio_trigger_notify_done(). The success path at the end does, so on a transient regmap or read failure the trigger's use_count is never decremented and iio_trigger_poll_chained() drops subsequent dispatches until the trigger is reattached. This is not a fix for a reported bug, only hardening against hardware or bus glitches; if a glitch is persistent the device is wedged and needs an unbind anyway, which is left to the user. Split the function so the inner helper returns bool with the data-read outcome, and the outer IRQ handler calls iio_trigger_notify_done() once and reports the result via IRQ_RETVAL(). Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
331ca76fe5
commit
d07bf43d17
1 changed files with 16 additions and 7 deletions
Loading…
Add table
Add a link
Reference in a new issue