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:
Stepan Ionichev 2026-05-18 23:11:10 +05:00 • committed by Jonathan Cameron
commit d07bf43d17