Commit d3616899 authored by Urs Fässler's avatar Urs Fässler Committed by Greg Kroah-Hartman

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 avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5fc76bbe
......@@ -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