public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ardelean, Alexandru" <alexandru.Ardelean@analog.com>
To: "sashal@kernel.org" <sashal@kernel.org>,
	"jic23@jic23.retrosnub.co.uk" <jic23@jic23.retrosnub.co.uk>
Cc: "stable@vger.kernel.org" <stable@vger.kernel.org>,
	"Jonathan.Cameron@huawei.com" <Jonathan.Cameron@huawei.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH AUTOSEL 5.4 137/350] iio: pressure: zpa2326: fix iio_triggered_buffer_postenable position
Date: Mon, 16 Dec 2019 07:50:32 +0000	[thread overview]
Message-ID: <0ff5f7ede826feb6185260a9d2c87fb89e799166.camel@analog.com> (raw)
In-Reply-To: <20191215155700.5183d752@archlinux>

On Sun, 2019-12-15 at 15:57 +0000, Jonathan Cameron wrote:
> [External]
> 
> On Tue, 10 Dec 2019 16:04:02 -0500
> Sasha Levin <sashal@kernel.org> wrote:
> 
> > From: Alexandru Ardelean <alexandru.ardelean@analog.com>
> > 
> > [ Upstream commit fe2392c67db9730d46f11fc4fadfa7bffa8843fa ]
> > 
> > The iio_triggered_buffer_{predisable,postenable} functions
> > attach/detach
> > the poll functions.
> > 
> > The iio_triggered_buffer_postenable() should be called before (to
> > attach
> > the poll func) and then the
> > 
> > The iio_triggered_buffer_predisable() function is hooked directly
> > without
> > anything, which is probably fine, as the postenable() version seems to
> > also
> > do some reset/wake-up of the device.
> > This will mean it will be easier when removing it; i.e. it just gets
> > removed.
> 
> Ah. I should have added a note to this one as well.  This is more general
> rework, that is a fix in the sense of bringing things towards a standard
> way of doing things rather than 'fixing' a known bug.
> 
> Alex, for any more of these, lets not have fix in the title (though they
> sort of do 'fix' things).
> 

Ack.
I don't think there are many drivers left though.
But will keep this in mind.

Thanks
Alex


> Thanks,
> 
> Jonathan
> 
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Signed-off-by: Sasha Levin <sashal@kernel.org>
> > ---
> >  drivers/iio/pressure/zpa2326.c | 16 +++++++++-------
> >  1 file changed, 9 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/iio/pressure/zpa2326.c
> > b/drivers/iio/pressure/zpa2326.c
> > index 9d0d07930236e..99dfe33ee402f 100644
> > --- a/drivers/iio/pressure/zpa2326.c
> > +++ b/drivers/iio/pressure/zpa2326.c
> > @@ -1243,6 +1243,11 @@ static int zpa2326_postenable_buffer(struct
> > iio_dev *indio_dev)
> >  	const struct zpa2326_private *priv = iio_priv(indio_dev);
> >  	int                           err;
> >  
> > +	/* Plug our own trigger event handler. */
> > +	err = iio_triggered_buffer_postenable(indio_dev);
> > +	if (err)
> > +		goto err;
> > +
> >  	if (!priv->waken) {
> >  		/*
> >  		 * We were already power supplied. Just clear hardware FIFO
> > to
> > @@ -1250,7 +1255,7 @@ static int zpa2326_postenable_buffer(struct
> > iio_dev *indio_dev)
> >  		 */
> >  		err = zpa2326_clear_fifo(indio_dev, 0);
> >  		if (err)
> > -			goto err;
> > +			goto err_buffer_predisable;
> >  	}
> >  
> >  	if (!iio_trigger_using_own(indio_dev) && priv->waken) {
> > @@ -1260,16 +1265,13 @@ static int zpa2326_postenable_buffer(struct
> > iio_dev *indio_dev)
> >  		 */
> >  		err = zpa2326_config_oneshot(indio_dev, priv->irq);
> >  		if (err)
> > -			goto err;
> > +			goto err_buffer_predisable;
> >  	}
> >  
> > -	/* Plug our own trigger event handler. */
> > -	err = iio_triggered_buffer_postenable(indio_dev);
> > -	if (err)
> > -		goto err;
> > -
> >  	return 0;
> >  
> > +err_buffer_predisable:
> > +	iio_triggered_buffer_predisable(indio_dev);
> >  err:
> >  	zpa2326_err(indio_dev, "failed to enable buffering (%d)", err);
> >  

  reply	other threads:[~2019-12-16  7:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191210210735.9077-1-sashal@kernel.org>
2019-12-10 21:02 ` [PATCH AUTOSEL 5.4 074/350] iio: proximity: sx9500: fix iio_triggered_buffer_{predisable,postenable} positions Sasha Levin
2019-12-15 15:52   ` Jonathan Cameron
2019-12-10 21:03 ` [PATCH AUTOSEL 5.4 105/350] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position Sasha Levin
2019-12-15 15:53   ` Jonathan Cameron
2019-12-15 23:25     ` Matt Ranostay
2019-12-19 17:34       ` Sasha Levin
2019-12-10 21:03 ` [PATCH AUTOSEL 5.4 116/350] iio: adc: max1027: Reset the device at probe time Sasha Levin
2019-12-10 21:03 ` [PATCH AUTOSEL 5.4 117/350] iio: dac: ad7303: replace mlock with own lock Sasha Levin
2019-12-15 15:55   ` Jonathan Cameron
2019-12-10 21:03 ` [PATCH AUTOSEL 5.4 129/350] staging: iio: ad9834: add a check for devm_clk_get Sasha Levin
2019-12-10 21:04 ` [PATCH AUTOSEL 5.4 137/350] iio: pressure: zpa2326: fix iio_triggered_buffer_postenable position Sasha Levin
2019-12-15 15:57   ` Jonathan Cameron
2019-12-16  7:50     ` Ardelean, Alexandru [this message]
2019-12-10 21:04 ` [PATCH AUTOSEL 5.4 192/350] iio: dln2-adc: fix iio_triggered_buffer_postenable() position Sasha Levin
2019-12-15 15:58   ` Jonathan Cameron
2019-12-10 21:06 ` [PATCH AUTOSEL 5.4 256/350] iio: imu: st_lsm6dsx: fix ODR check in st_lsm6dsx_write_raw Sasha Levin
2019-12-10 21:06 ` [PATCH AUTOSEL 5.4 260/350] iio: cros_ec_baro: set info_mask_shared_by_all_available field Sasha Levin
2019-12-10 21:06 ` [PATCH AUTOSEL 5.4 266/350] iio: dac: ad5446: Add support for new AD5600 DAC Sasha Levin
2019-12-10 21:06 ` [PATCH AUTOSEL 5.4 268/350] iio: adis16480: Fix scales factors Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ff5f7ede826feb6185260a9d2c87fb89e799166.camel@analog.com \
    --to=alexandru.ardelean@analog.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=jic23@jic23.retrosnub.co.uk \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox