Re: [PATCH v3 1/3] iio: light: rohm-bu27034: Fix infinite delay on error

From: Jonathan Cameron

Date: Sun Sep 06 2026 - 17:34:17 EST


On Wed, 2 Sep 2026 11:48:46 +0300
Matti Vaittinen <matti.vaittinen@xxxxxxxxx> wrote:

> From: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
>
> When reading an integration-time fails, the code will use error code to
> compute the sleep time.
>
> Fix this by using the smallest integration time as a default if
> reading fails.
>
> Fixes: e52afbd61039 ("iio: light: ROHM BU27034 Ambient Light Sensor")
> Suggested-by: Jonathan Cameron <jic23@xxxxxxxxxx>
> Signed-off-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
>
> ---
>
> I am not happy how intrusive this patch is for a fix. I really believe
> what I suggested in discussion:
>
> wait_ms = bu27034_get_int_time(data) / USEC_PER_MSEC;
> if (wait_ms < BU27034_INT_TIME_MIN_MS)
> wait_ms = BU27034_INT_TIME_MIN_MS;

I really dislike messing with error codes like that division is doing
so I do prefer this though I get that it is a bit noisy.

So applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan