Re: [PATCH 08/12] iio: light: rohm-bu27034: Fix error return

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

> From: Matti Vaittinen <[email protected]>
> 
> When BU27034 fails to read gain value at integration-time setting, it
> returns 0. This leaves caller unaware of the fact that setting the
> integration time failed.
> 
> Fix this by returning the relevant error instead of zero.
> 
> Signed-off-by: Matti Vaittinen <[email protected]>
> Fixes: 439c2cef8157 ("iio: bu27034: simplify using guard(mutex)")
Applied.

Note I skipped 7 until that discussion comes to a conclusion.

Thanks,

Jonathan

> ---
>  drivers/iio/light/rohm-bu27034.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/light/rohm-bu27034.c b/drivers/iio/light/rohm-bu27034.c
> index 28d111ac8c0a..f9a421618406 100644
> --- a/drivers/iio/light/rohm-bu27034.c
> +++ b/drivers/iio/light/rohm-bu27034.c
> @@ -415,7 +415,7 @@ static int bu27034_try_set_int_time(struct bu27034_data *data, int time_us)
>  	for (i = 0; i < numg; i++) {
>  		ret = bu27034_get_gain(data, gains[i].chan, &gains[i].old_gain);
>  		if (ret)
> -			return 0;
> +			return ret;
>  
>  		ret = iio_gts_find_new_gain_by_old_gain_time(&data->gts,
>  							     gains[i].old_gain,
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.