Re: [PATCH 06/12] iio: pressure: rohm-bm1390: Return error when read fails

From: Jonathan Cameron

Date: Sun Aug 16 2026 - 21:34:52 EST


On Mon, 10 Aug 2026 10:52:47 +0300
Matti Vaittinen <matti.vaittinen@xxxxxxxxx> wrote:

> From: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
>
> The data reading function ignores the cached error value, and
> unconditionally returns 0. Return cached 'ret' -value after stopping
> the measurement so user knows if read failed and data is garbage.
>
> Signed-off-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
> Fixes: 534674463a59 ("iio: bm1390: simplify using guard(mutex)")
Applied.
Thanks,

J
> ---
> drivers/iio/pressure/rohm-bm1390.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/pressure/rohm-bm1390.c b/drivers/iio/pressure/rohm-bm1390.c
> index b3be9de03678..d00d7ed54cb1 100644
> --- a/drivers/iio/pressure/rohm-bm1390.c
> +++ b/drivers/iio/pressure/rohm-bm1390.c
> @@ -289,7 +289,7 @@ static int bm1390_read_data(struct bm1390_data *data,
> if (warn)
> dev_warn(data->dev, "Failed to stop measurement (%d)\n", warn);
>
> - return 0;
> + return ret;
> }
>
> static int bm1390_read_raw(struct iio_dev *idev,