[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <52F6191D.3070404@kernel.org>
Date: Sat, 08 Feb 2014 11:46:37 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Guenter Roeck <linux@...ck-us.net>
CC: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: max1363: Use devm_regulator_get_optional for optional
regulator
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@...ck-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;
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists