Re: [PATCH 1/3] iio: pressure: dps310: reject a zero rate or oversampling ratio
From: Joshua Crofts
Date: Fri Oct 30 2026 - 04:19:25 EST
On Fri, 30 Oct 2026 00:06:33 +0200
Rupesh Majhi <zoone.rupert@xxxxxxxxx> wrote:
> The rate and ratio setters accept 0, which also covers 0.5. ilog2(0)
> gives -1, which masked into the register is 128 Hz or the reserved
> precision 0b1111. The latter makes every pressure read fail with
> -ERANGE and temperature read 974 degrees C.
>
> Reject values below 1.
>
> Fixes: ba6ec48e76bc ("iio: Add driver for Infineon DPS310")
> Fixes: d711a3c7dc82 ("iio: dps310: Add pressure sensing capability")
> Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Closes: https://sashiko.dev/#/patchset/20260921183132.233136-1-zoone.rupert%40gmail.com
> Signed-off-by: Rupesh Majhi <zoone.rupert@xxxxxxxxx>
> ---
Reviewed-by: Joshua Crofts <crofts@xxxxxxxxxx>
--
Kind regards,
Joshua Crofts