mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
iio: adis_buffer: update device page after changing it
It makes more sense to update the device page as soon as we we successfully changed it. Moreover, a follow up patch will handle 'spi_sync' error path which would leave 'current_page' in a inconsistent state. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/20210427085454.30616-3-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
00a72db718
commit
0ae157081c
1 changed files with 3 additions and 3 deletions
|
@ -140,6 +140,8 @@ static irqreturn_t adis_trigger_handler(int irq, void *p)
|
|||
mutex_unlock(&adis->state_lock);
|
||||
goto irq_done;
|
||||
}
|
||||
|
||||
adis->current_page = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,10 +150,8 @@ static irqreturn_t adis_trigger_handler(int irq, void *p)
|
|||
dev_err(&adis->spi->dev, "Failed to read data: %d", ret);
|
||||
|
||||
|
||||
if (adis->data->has_paging) {
|
||||
adis->current_page = 0;
|
||||
if (adis->data->has_paging)
|
||||
mutex_unlock(&adis->state_lock);
|
||||
}
|
||||
|
||||
iio_push_to_buffers_with_timestamp(indio_dev, adis->buffer,
|
||||
pf->timestamp);
|
||||
|
|
Loading…
Reference in a new issue