From: Jonathan Cameron <jic23@kernel.org>
To: Mark Brown <broonie@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/3] iio:ad7266: Fix broken regulator error handling
Date: Sun, 26 Jun 2016 17:40:17 +0100 [thread overview]
Message-ID: <d8ff6bc9-a65d-a25e-f6fe-18e953fe79bf@kernel.org> (raw)
In-Reply-To: <1466427214-13372-1-git-send-email-broonie@kernel.org>
On 20/06/16 13:53, Mark Brown wrote:
> All regulator_get() variants return either a pointer to a regulator or an
> ERR_PTR() so testing for NULL makes no sense and may lead to bugs if we
> use NULL as a valid regulator. Fix this by using IS_ERR() as expected.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
Applied to the fixes-togreg branch of iio.git and marked for stable.
Thanks Mark,
Jonathan
> ---
> drivers/iio/adc/ad7266.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c
> index 21e19b60e2b9..835d45db258f 100644
> --- a/drivers/iio/adc/ad7266.c
> +++ b/drivers/iio/adc/ad7266.c
> @@ -397,7 +397,7 @@ static int ad7266_probe(struct spi_device *spi)
> st = iio_priv(indio_dev);
>
> st->reg = devm_regulator_get(&spi->dev, "vref");
> - if (!IS_ERR_OR_NULL(st->reg)) {
> + if (!IS_ERR(st->reg)) {
> ret = regulator_enable(st->reg);
> if (ret)
> return ret;
>
prev parent reply other threads:[~2016-06-26 16:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 12:53 [PATCH 1/3] iio:ad7266: Fix broken regulator error handling Mark Brown
2016-06-20 12:53 ` [PATCH 2/3] iio:ad7266: Fix support for optional regulators Mark Brown
2016-06-26 16:40 ` Jonathan Cameron
2016-06-20 12:53 ` [PATCH 3/3] iio:ad7266: Fix probe deferral for vref Mark Brown
2016-06-26 16:41 ` Jonathan Cameron
2016-06-27 8:35 ` Linus Walleij
2016-06-26 16:40 ` 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=d8ff6bc9-a65d-a25e-f6fe-18e953fe79bf@kernel.org \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=broonie@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--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).