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

Jonathan Cameron <[email protected]>
Newsgroups gmane.linux.kernel.iio,gmane.linux.kernel
Message-ID <20260817023436.1cf2d10e@jic23-huawei>
On Mon, 10 Aug 2026 10:52:47 +0300
Matti Vaittinen <[email protected]> wrote:

> From: Matti Vaittinen <[email protected]>
> 
> 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 <[email protected]>
> 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,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.