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 <[email protected]>
Acked-by: Lars-Peter Clausen <[email protected]>
Cc: [email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
This commit is contained in:
Urs Fässler 2015-02-02 17:12:23 +01:00 • committed by Jonathan Cameron
commit da019f59cb

View file

@ -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)