summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-01-27 18:10:00 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-22 13:34:51 -0800
commit45a77a9faa9f7d0da102ad224bf669a2a21a4cda (patch)
tree039491f0fcb7a4647b6b64f57650cd60db8c4f52
parent0ced5ac8b802221153c432ba5f342159dae69c42 (diff)
downloadlwn-45a77a9faa9f7d0da102ad224bf669a2a21a4cda.tar.gz
lwn-45a77a9faa9f7d0da102ad224bf669a2a21a4cda.zip
iio: max1363: Use devm_regulator_get_optional for optional regulator
commit 55b40d37311807a6bb2acdae0df904f54a0da3ae upstream. 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> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/iio/adc/max1363.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c
index 6118dced02b6..5edb991a5e12 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;