[PATCH 3.13.y-ckt 007/156] iio: ad5686: fix optional reference voltage declaration

Kamal Mostafa kamal at canonical.com
Tue Apr 7 22:49:04 UTC 2015


3.13.11-ckt19 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: =?UTF-8?q?Urs=20F=C3=A4ssler?= <urs.fassler at bytesatwork.ch>

commit da019f59cb16570e78feaf10380ac65a3a06861e upstream.

When not using the "_optional" function, a dummy regulator is returned
and the driver fails to initialize.

Signed-off-by: Urs Fässler <urs.fassler at bytesatwork.ch>
Acked-by: Lars-Peter Clausen <lars at metafoo.de>
Signed-off-by: Jonathan Cameron <jic23 at kernel.org>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 drivers/iio/dac/ad5686.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c
index 30e506e..c0dc0f0 100644
--- a/drivers/iio/dac/ad5686.c
+++ b/drivers/iio/dac/ad5686.c
@@ -317,7 +317,7 @@ static int ad5686_probe(struct spi_device *spi)
 	st = iio_priv(indio_dev);
 	spi_set_drvdata(spi, indio_dev);
 
-	st->reg = devm_regulator_get(&spi->dev, "vcc");
+	st->reg = devm_regulator_get_optional(&spi->dev, "vcc");
 	if (!IS_ERR(st->reg)) {
 		ret = regulator_enable(st->reg);
 		if (ret)
-- 
1.9.1





More information about the kernel-team mailing list