* [PATCH] iio: max1363: Use devm_regulator_get_optional for optional regulator
@ 2014-01-27 18:10 Guenter Roeck
2014-02-08 11:46 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Guenter Roeck @ 2014-01-27 18:10 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio, linux-kernel, Guenter Roeck
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>
---
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;
--
1.7.9.7
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] iio: max1363: Use devm_regulator_get_optional for optional regulator
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
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2014-02-08 11:46 UTC (permalink / raw)
To: Guenter Roeck; +Cc: linux-iio, linux-kernel
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;
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-08 11:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox