Commit 980b325b authored by Urs Fässler's avatar Urs Fässler Committed by Luis Henriques

iio: ad5686: fix optional reference voltage declaration

commit da019f59 upstream.

When not using the "_optional" function, a dummy regulator is returned
and the driver fails to initialize.
Signed-off-by: default avatarUrs Fässler <urs.fassler@bytesatwork.ch>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 41fe3862
......@@ -322,7 +322,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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment