From: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>,
linux-iio@vger.kernel.org, Michael.Hennerich@analog.com
Subject: Re: [PATCH] iio: amplifiers: ad8366: move channel init before iio_device_register()
Date: Tue, 22 May 2018 18:16:56 +0100 [thread overview]
Message-ID: <20180522181656.3ab9f7c4@archlinux> (raw)
In-Reply-To: <3522029f-ab8d-b368-6f7e-ee33cb6ed999@metafoo.de>
On Mon, 21 May 2018 17:10:00 +0200
Lars-Peter Clausen <lars@metafoo.de> wrote:
> Patch looks good, but remember to put the maintainer and reviewers on the
> recipient list. Otherwise there is a risk that the patch gets lost.
>
> On 05/21/2018 08:40 AM, Alexandru Ardelean wrote:
> > Otherwise a race condition can occur, where userspace can start operations
> > before the channels have been properly initialized.
> >
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.
Thanks,
Jonathan
> > ---
> > drivers/iio/amplifiers/ad8366.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad8366.c
> > index 43667866321e..0138337aedd1 100644
> > --- a/drivers/iio/amplifiers/ad8366.c
> > +++ b/drivers/iio/amplifiers/ad8366.c
> > @@ -161,12 +161,14 @@ static int ad8366_probe(struct spi_device *spi)
> > indio_dev->channels = ad8366_channels;
> > indio_dev->num_channels = ARRAY_SIZE(ad8366_channels);
> >
> > + ret = ad8366_write(indio_dev, 0 , 0);
> > + if (ret < 0)
> > + goto error_disable_reg;
> > +
> > ret = iio_device_register(indio_dev);
> > if (ret)
> > goto error_disable_reg;
> >
> > - ad8366_write(indio_dev, 0, 0);
> > -
> > return 0;
> >
> > error_disable_reg:
> >
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2018-05-22 17:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-21 6:40 [PATCH] iio: amplifiers: ad8366: move channel init before iio_device_register() Alexandru Ardelean
2018-05-21 15:10 ` Lars-Peter Clausen
2018-05-22 17:16 ` Jonathan Cameron [this message]
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=20180522181656.3ab9f7c4@archlinux \
--to=jic23@jic23.retrosnub.co.uk \
--cc=Michael.Hennerich@analog.com \
--cc=alexandru.ardelean@analog.com \
--cc=lars@metafoo.de \
--cc=linux-iio@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;
as well as URLs for NNTP newsgroup(s).