提交 669da56a 编写于 作者: N Nuno Sa 提交者: Jonathan Cameron

iio: adis_buffer: don't push data to buffers on failure

There's no point in pushing data to IIO buffers in case 'spi_sync()'
fails.
Reviewed-by: NAlexandru Ardelean <ardeleanalex@gmail.com>
Signed-off-by: NNuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210427085454.30616-4-nuno.sa@analog.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
上级 0ae15708
......@@ -146,12 +146,12 @@ static irqreturn_t adis_trigger_handler(int irq, void *p)
}
ret = spi_sync(adis->spi, &adis->msg);
if (ret)
dev_err(&adis->spi->dev, "Failed to read data: %d", ret);
if (adis->data->has_paging)
mutex_unlock(&adis->state_lock);
if (ret) {
dev_err(&adis->spi->dev, "Failed to read data: %d", ret);
goto irq_done;
}
iio_push_to_buffers_with_timestamp(indio_dev, adis->buffer,
pf->timestamp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册