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 2/3] iio:ad7266: Fix support for optional regulators
Date: Sun, 26 Jun 2016 17:40:40 +0100 [thread overview]
Message-ID: <f37e6429-743f-96e6-17f2-edf56e5440f5@kernel.org> (raw)
In-Reply-To: <1466427214-13372-2-git-send-email-broonie@kernel.org>
On 20/06/16 13:53, Mark Brown wrote:
> The ad7266 driver attempts to support deciding between the use of internal
> and external power supplies by checking to see if an error is returned when
> requesting the regulator. This doesn't work with the current code since the
> driver uses a normal regulator_get() which is for non-optional supplies
> and so assumes that if a regulator is not provided by the platform then
> this is a bug in the platform integration and so substitutes a dummy
> regulator. Use regulator_get_optional() instead which indicates to the
> framework that the regulator may be absent and provides a dummy regulator
> instead.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
Applied to the fixes-togreg branch of iio.git and marked for stable.
Thanks,
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 835d45db258f..655b36b4e9cb 100644
> --- a/drivers/iio/adc/ad7266.c
> +++ b/drivers/iio/adc/ad7266.c
> @@ -396,7 +396,7 @@ static int ad7266_probe(struct spi_device *spi)
>
> st = iio_priv(indio_dev);
>
> - st->reg = devm_regulator_get(&spi->dev, "vref");
> + st->reg = devm_regulator_get_optional(&spi->dev, "vref");
> if (!IS_ERR(st->reg)) {
> ret = regulator_enable(st->reg);
> if (ret)
>
next 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 [this message]
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 ` [PATCH 1/3] iio:ad7266: Fix broken regulator error handling Jonathan Cameron
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=f37e6429-743f-96e6-17f2-edf56e5440f5@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).