From: Jonathan Cameron <jic23@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: max1363: Use devm_regulator_get_optional for optional regulator
Date: Sat, 08 Feb 2014 11:46:37 +0000 [thread overview]
Message-ID: <52F6191D.3070404@kernel.org> (raw)
In-Reply-To: <1390846227-28320-1-git-send-email-linux@roeck-us.net>
On 27/01/14 18:10, Guenter Roeck wrote:
> In kernel version 3.13, devm_regulator_get() may return no error
> if a regulator is undeclared. regulator_get_voltage() will return
> -EINVAL if this happens. This causes the driver to fail loading if
> the vref regulator is not declared.
>
> Since vref is optional, call devm_regulator_get_optional instead.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Applied and marked for stable.
Thanks,
> ---
> Should be a candidate for -stable (v3.12+).
>
> drivers/iio/adc/max1363.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c
> index e283f2f..3602592 100644
> --- a/drivers/iio/adc/max1363.c
> +++ b/drivers/iio/adc/max1363.c
> @@ -1560,7 +1560,7 @@ static int max1363_probe(struct i2c_client *client,
> st->client = client;
>
> st->vref_uv = st->chip_info->int_vref_mv * 1000;
> - vref = devm_regulator_get(&client->dev, "vref");
> + vref = devm_regulator_get_optional(&client->dev, "vref");
> if (!IS_ERR(vref)) {
> int vref_uv;
>
>
prev parent reply other threads:[~2014-02-08 11:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-27 18:10 [PATCH] iio: max1363: Use devm_regulator_get_optional for optional regulator Guenter Roeck
2014-02-08 11:46 ` 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=52F6191D.3070404@kernel.org \
--to=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.