Re: [PATCH] iio: accel: sca3000: fix frequency divider condition check
From: Andy Shevchenko
Date: Wed Aug 19 2026 - 09:38:40 EST
On Wed, Aug 19, 2026 at 12:41:01PM +0100, Salah Triki wrote:
> When setting the sampling frequency, the check for `base_freq / 2` is
> followed by an independent `if` statement for `base_freq / 4`. If `val`
> equals `base_freq / 2`, the second check fails and falls through to the
> `else if (val != base_freq)` branch, returning `-EINVAL` erroneously.
>
> Fix this by chaining the checks with `else if`.
This needs a Fixes tag.
--
With Best Regards,
Andy Shevchenko