Commit da019f59 authored by Urs Fässler's avatar Urs Fässler Committed by Jonathan Cameron

iio: ad5686: fix optional reference voltage declaration

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>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 9e128ced
...@@ -322,7 +322,7 @@ static int ad5686_probe(struct spi_device *spi) ...@@ -322,7 +322,7 @@ static int ad5686_probe(struct spi_device *spi)
st = iio_priv(indio_dev); st = iio_priv(indio_dev);
spi_set_drvdata(spi, 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)) { if (!IS_ERR(st->reg)) {
ret = regulator_enable(st->reg); ret = regulator_enable(st->reg);
if (ret) 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