Skip to content

Commit

Permalink
iio: imu: bmi323: Fix trigger notification in case of error
Browse files Browse the repository at this point in the history
In case of error in the bmi323_trigger_handler() function, the
function exits without calling the iio_trigger_notify_done()
which is responsible for informing the attached trigger that
the process is done and in case there is a .reenable(), to
call it.

Fixes: 8a636db ("iio: imu: Add driver for BMI323 IMU")
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://lore.kernel.org/r/20240508155407.139805-1-vassilisamir@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Vasileios Amoiridis authored and Jonathan Cameron committed May 27, 2024
1 parent 279428d commit bedb2cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/iio/imu/bmi323/bmi323_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ static irqreturn_t bmi323_trigger_handler(int irq, void *p)
&data->buffer.channels,
ARRAY_SIZE(data->buffer.channels));
if (ret)
return IRQ_NONE;
goto out;
} else {
for_each_set_bit(bit, indio_dev->active_scan_mask,
BMI323_CHAN_MAX) {
Expand All @@ -1400,13 +1400,14 @@ static irqreturn_t bmi323_trigger_handler(int irq, void *p)
&data->buffer.channels[index++],
BMI323_BYTES_PER_SAMPLE);
if (ret)
return IRQ_NONE;
goto out;
}
}

iio_push_to_buffers_with_timestamp(indio_dev, &data->buffer,
iio_get_time_ns(indio_dev));

out:
iio_trigger_notify_done(indio_dev->trig);

return IRQ_HANDLED;
Expand Down

0 comments on commit bedb2cc

Please sign in to comment.