iio: max1363: Use devm_regulator_get_optional for optional regulator
authorGuenter Roeck <linux@roeck-us.net>
Mon, 27 Jan 2014 18:10:00 +0000 (18:10 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Feb 2014 21:32:27 +0000 (13:32 -0800)
commit5be594952c283412027639d60bc51116f64fdcbe
tree6f4c99482e5012d884bca2ad2f0df06d4366c68c
parentaee63f4dc12b2f5208c8fcd44185f26422ad6ed9
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>
drivers/iio/adc/max1363.c