[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46d418bd0546c98e22a0d331741c053274c2170f.camel@analog.com>
Date: Mon, 28 Oct 2019 07:11:51 +0000
From: "Ardelean, Alexandru" <alexandru.Ardelean@...log.com>
To: "jic23@...nel.org" <jic23@...nel.org>,
"matt.ranostay@...sulko.com" <matt.ranostay@...sulko.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>
Subject: Re: [PATCH] iio: hdc100x: fix
iio_triggered_buffer_{predisable,postenable} positions
On Sun, 2019-10-27 at 20:37 +0200, Matt Ranostay wrote:
> [External]
>
> On Sun, Oct 27, 2019 at 6:58 PM Jonathan Cameron <jic23@...nel.org>
> wrote:
> > On Wed, 23 Oct 2019 11:27:14 +0300
> > Alexandru Ardelean <alexandru.ardelean@...log.com> wrote:
> >
> > > The iio_triggered_buffer_postenable() hook should be called first to
> > > attach the poll function and the iio_triggered_buffer_predisable()
> > > hook
> > > should be called last in the predisable hook.
> > >
> > > This change updates the driver to attach/detach the poll func in the
> > > correct order.
> > >
> > > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@...log.com>
> > Seems fine, but should have cc'd Matt and I'd like to give him time
> > to take a quick look.
> >
>
> Reviewed-by: Matt Ranostay <matt.ranostay@...sulko.com>
Apologies for not CC-ing Matt.
I guess I wasn't paying [close enough] attention to the output of
get_maintainers.pl
Thanks
Alex
>
> > +CC Matt.
> >
> > Thanks,
> >
> > Jonathan
> >
> > > ---
> > > drivers/iio/humidity/hdc100x.c | 19 +++++++++++--------
> > > 1 file changed, 11 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/drivers/iio/humidity/hdc100x.c
> > > b/drivers/iio/humidity/hdc100x.c
> > > index bfe1cdb16846..963ff043eecf 100644
> > > --- a/drivers/iio/humidity/hdc100x.c
> > > +++ b/drivers/iio/humidity/hdc100x.c
> > > @@ -278,31 +278,34 @@ static int hdc100x_buffer_postenable(struct
> > > iio_dev *indio_dev)
> > > struct hdc100x_data *data = iio_priv(indio_dev);
> > > int ret;
> > >
> > > + ret = iio_triggered_buffer_postenable(indio_dev);
> > > + if (ret)
> > > + return ret;
> > > +
> > > /* Buffer is enabled. First set ACQ Mode, then attach poll func
> > > */
> > > mutex_lock(&data->lock);
> > > ret = hdc100x_update_config(data, HDC100X_REG_CONFIG_ACQ_MODE,
> > > HDC100X_REG_CONFIG_ACQ_MODE);
> > > mutex_unlock(&data->lock);
> > > if (ret)
> > > - return ret;
> > > + iio_triggered_buffer_predisable(indio_dev);
> > >
> > > - return iio_triggered_buffer_postenable(indio_dev);
> > > + return ret;
> > > }
> > >
> > > static int hdc100x_buffer_predisable(struct iio_dev *indio_dev)
> > > {
> > > struct hdc100x_data *data = iio_priv(indio_dev);
> > > - int ret;
> > > -
> > > - /* First detach poll func, then reset ACQ mode. OK to disable
> > > buffer */
> > > - ret = iio_triggered_buffer_predisable(indio_dev);
> > > - if (ret)
> > > - return ret;
> > > + int ret, ret2;
> > >
> > > mutex_lock(&data->lock);
> > > ret = hdc100x_update_config(data, HDC100X_REG_CONFIG_ACQ_MODE,
> > > 0);
> > > mutex_unlock(&data->lock);
> > >
> > > + ret2 = iio_triggered_buffer_predisable(indio_dev);
> > > + if (ret == 0)
> > > + ret = ret2;
> > > +
> > > return ret;
> > > }
> > >
Powered by blists - more mailing lists