[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXDNZWSWpuDPzdwv@smile.fi.intel.com>
Date: Wed, 21 Jan 2026 14:58:13 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Tomas Melin <tomas.melin@...sala.com>
Cc: Michael Hennerich <Michael.Hennerich@...log.com>,
Nuno Sa <nuno.sa@...log.com>, Lars-Peter Clausen <lars@...afoo.de>,
Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Andy Shevchenko <andy@...nel.org>,
Olivier Moysan <olivier.moysan@...s.st.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 4/4] iio: adc: ad9467: check for backend capabilities
On Wed, Jan 21, 2026 at 12:08:33PM +0000, 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.
...
> static int __ad9467_update_clock(struct ad9467_state *st, long r_clk)
> if (ret)
> return ret;
>
> - guard(mutex)(&st->lock);
I would leave this as is. Yes, practically we don't need to cover
iio_backend_has_caps() with mutex to access the data, but it just makes code
slightly more maintainable in my opinion. If anything appears here, it would
probably mean some kind of if (...) do_blablabla(...); pattern that will need
a mutex.
> - return ad9467_calibrate(st);
> + if (iio_backend_has_caps(st->back, IIO_BACKEND_CAP_CALIBRATION)) {
> + guard(mutex)(&st->lock);
> + return ad9467_calibrate(st);
> + }
> + return 0;
> }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists