[PATCH v2 13/16] iio: core: introduce iio_device_{claim|release}_buffer_mode() APIs
Nuno Sá
noname.nuno at gmail.com
Mon Oct 10 00:03:44 PDT 2022
On Sun, 2022-10-09 at 12:41 +0100, Jonathan Cameron wrote:
> On Wed, 05 Oct 2022 10:37:39 +0200
> Nuno Sá <noname.nuno at gmail.com> wrote:
>
> > On Tue, 2022-10-04 at 17:08 +0300, Andy Shevchenko wrote:
> > > On Tue, Oct 4, 2022 at 4:49 PM Nuno Sá <nuno.sa at analog.com>
> > > wrote:
> > > >
> > > > These APIs are analogous to iio_device_claim_direct_mode() and
> > > > iio_device_release_direct_mode() but, as the name suggests,
> > > > with
> > > > the
> > > > logic flipped. While this looks odd enough, it will have at
> > > > least
> > > > two
> > > > users (in following changes) and it will be important to move
> > > > the
> > > > iio
> > > > mlock to the private struct.
> > >
> > > ...
> > >
> > > > +int iio_device_claim_buffer_mode(struct iio_dev *indio_dev)
> > > > +{
> > > > + mutex_lock(&indio_dev->mlock);
> > > > +
> > > > + if (iio_buffer_enabled(indio_dev))
> > >
> > > Do you need to annotate these two APIs to make sparse happy about
> > > locking balance?
> > >
> > > (Try to run `make W=1 C=1 ...` with your patches and look if any
> > > new
> > > warnings appear.)
> >
> > make W=1 C=1 drivers/iio/industrialio-core.o
> > # UPD include/config/kernel.release
>
> ...
>
> > drivers/iio/industrialio-core.c:2100: warning: expecting prototype
> > for
> > iio_device_claim_buffered_mode(). Prototype was for
> > iio_device_claim_buffer_mode() instead
>
> That one wants fixing as this patch introduces it.
>
Bah, That's why another pair of eyes is useful... I looked for that
warning without seeing what it was complaining about. Now, I could
finally see it :)
- Nuno Sá
>
More information about the Linux-rockchip
mailing list