Commit 328499bc authored by Urs Fässler's avatar Urs Fässler Committed by Sasha Levin

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 avatarSasha Levin <sasha.levin@oracle.com>
parent 30fa0dbf
...@@ -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