Re: [PATCH v6 5/5] iio: adc: ad9467: check for backend capabilities
From: David Lechner
Date: Sat Feb 07 2026 - 13:43:17 EST
On 2/5/26 6:24 AM, Tomas Melin wrote:
> Add capability checks for operation with backends that do not necessarily
> support full set of features, but are otherwise compatible with the device.
> This ensures a fully functional device, but with limited capabilities.
>
> Signed-off-by: Tomas Melin <tomas.melin@xxxxxxxxxxx>
> ---
> drivers/iio/adc/ad9467.c | 67 +++++++++++++++++++++++++++++-------------------
> 1 file changed, 41 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
> index 59c3fa3bcc9b..7a3db36121b0 100644
> --- a/drivers/iio/adc/ad9467.c
> +++ b/drivers/iio/adc/ad9467.c
> @@ -913,7 +913,9 @@ static int __ad9467_update_clock(struct ad9467_state *st, long r_clk)
> return ret;
>
> guard(mutex)(&st->lock);
> - return ad9467_calibrate(st);
> + if (iio_backend_has_caps(st->back, IIO_BACKEND_CAP_CALIBRATION))
> + return ad9467_calibrate(st);
> + return 0;
> }
>
I would appreciate a blank line before and after the if statement
if we end up needing a v7.