Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Urs Fässler and committed by
Jonathan Cameron
da019f59 9e128ced

+1 -1
+1 -1
drivers/iio/dac/ad5686.c
··· 322 322 st = iio_priv(indio_dev); 323 323 spi_set_drvdata(spi, indio_dev); 324 324 325 - st->reg = devm_regulator_get(&spi->dev, "vcc"); 325 + st->reg = devm_regulator_get_optional(&spi->dev, "vcc"); 326 326 if (!IS_ERR(st->reg)) { 327 327 ret = regulator_enable(st->reg); 328 328 if (ret)