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: Urs Fässler <urs.fassler@bytesatwork.ch> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
9e128ced38
commit
da019f59cb
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue