From: Jonathan Cameron <jic23@kernel.org>
To: "Ardelean, Alexandru" <alexandru.Ardelean@analog.com>
Cc: "hslester96@gmail.com" <hslester96@gmail.com>,
"pmeerw@pmeerw.net" <pmeerw@pmeerw.net>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"lars@metafoo.de" <lars@metafoo.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"paul.cercueil@analog.com" <paul.cercueil@analog.com>,
"Hennerich, Michael" <Michael.Hennerich@analog.com>,
"knaack.h@gmx.de" <knaack.h@gmx.de>
Subject: Re: [PATCH v3] iio: amplifiers: ad8366: Change devm_gpiod_get() to optional and add the missed check
Date: Sat, 6 Jun 2020 16:12:59 +0100 [thread overview]
Message-ID: <20200606161259.146eb221@archlinux> (raw)
In-Reply-To: <36f033adf9b53adb289e7569ea5fca647c0dbb7a.camel@analog.com>
On Wed, 3 Jun 2020 10:19:12 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:
> On Wed, 2020-06-03 at 17:26 +0800, Chuhong Yuan wrote:
> > Since if there is no GPIO, nothing happens, replace devm_gpiod_get()
> > with devm_gpiod_get_optional().
> > Also add IS_ERR() to fix the missing-check bug.
> >
>
> Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied with layout tweaked a bit as per Markus' comment which made
sense in this particular case.
I also tweaked the description to say "missing-check" warning given
as we've established the failure to check for an error wasn't a problem
as such. On that basis I thought about dropping the fixes tag, but
it's 'sort' of a fix so I'll leave it there. Not sending this the
fast path however as is not urgent (shout if you disagree!)
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.
Thanks,
Jonathan
>
> > Fixes: cee211f4e5a0 ("iio: amplifiers: ad8366: Add support for the ADA4961
> > DGA")
> > Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> > ---
> > Changes in v3:
> > - Change devm_gpiod_get() to optional.
> > - Modify description.
> >
> > drivers/iio/amplifiers/ad8366.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad8366.c
> > index 62167b87caea..8819e8997f76 100644
> > --- a/drivers/iio/amplifiers/ad8366.c
> > +++ b/drivers/iio/amplifiers/ad8366.c
> > @@ -262,8 +262,12 @@ static int ad8366_probe(struct spi_device *spi)
> > case ID_ADA4961:
> > case ID_ADL5240:
> > case ID_HMC1119:
> > - st->reset_gpio = devm_gpiod_get(&spi->dev, "reset",
> > + st->reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset",
> > GPIOD_OUT_HIGH);
> > + if (IS_ERR(st->reset_gpio)) {
> > + ret = PTR_ERR(st->reset_gpio);
> > + goto error_disable_reg;
> > + }
> > indio_dev->channels = ada4961_channels;
> > indio_dev->num_channels = ARRAY_SIZE(ada4961_channels);
> > break;
next prev parent reply other threads:[~2020-06-06 15:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 9:26 [PATCH v3] iio: amplifiers: ad8366: Change devm_gpiod_get() to optional and add the missed check Chuhong Yuan
2020-06-03 10:19 ` Ardelean, Alexandru
2020-06-06 15:12 ` Jonathan Cameron [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-06-03 18:00 Markus Elfring
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=20200606161259.146eb221@archlinux \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=alexandru.Ardelean@analog.com \
--cc=hslester96@gmail.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.cercueil@analog.com \
--cc=pmeerw@pmeerw.net \
/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).