[PATCH 6/7] iio: adis_buffer: don't push data to buffers on failure

Nuno Sa
2021-04-13T11:19:10Z

There's no point in pushing data to IIO buffers in case 'spi_sync()'
fails.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
---
drivers/iio/imu/adis_buffer.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/imu/adis_buffer.c b/drivers/iio/imu/adis_buffer.c
index 7ab15c08889f..73790b71102b 100644
--- a/drivers/iio/imu/adis_buffer.c
+++ b/drivers/iio/imu/adis_buffer.c
@@ -146,9 +146,10 @@ static irqreturn_t adis_trigger_handler(int irq, void *p)
}

ret = spi_sync(adis->spi, &adis->msg);
- if (ret)
+ if (ret) {
dev_err(&adis->spi->dev, "Failed to read data: %d", ret);
-
+ goto irq_done;
+ }

if (adis->data->has_paging) {
adis->current_page = 0;
--
2.31.1