diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-07-04 08:15:03 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-07-04 08:15:03 -0700 |
commit | 7813029a509c0c92a5b16d846defaa50a2d3d7f1 (patch) | |
tree | 1962ab81537b7155d185f4b0b06c0323ff4dc509 /drivers/iio/adc/ad7266.c | |
parent | 3c9a6793bde1feb368cd6ef113c08a40a37f7517 (diff) | |
parent | a99cde438de0c4c0cecc1d1af1a55a75b10bfdef (diff) | |
download | talos-obmc-linux-7813029a509c0c92a5b16d846defaa50a2d3d7f1.tar.gz talos-obmc-linux-7813029a509c0c92a5b16d846defaa50a2d3d7f1.zip |
Merge 4.7-rc6 into staging-next
We want the staging fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/adc/ad7266.c')
-rw-r--r-- | drivers/iio/adc/ad7266.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c index 01240aeeeab0..11c65db14747 100644 --- a/drivers/iio/adc/ad7266.c +++ b/drivers/iio/adc/ad7266.c @@ -395,8 +395,8 @@ static int ad7266_probe(struct spi_device *spi) st = iio_priv(indio_dev); - st->reg = devm_regulator_get(&spi->dev, "vref"); - if (!IS_ERR_OR_NULL(st->reg)) { + st->reg = devm_regulator_get_optional(&spi->dev, "vref"); + if (!IS_ERR(st->reg)) { ret = regulator_enable(st->reg); if (ret) return ret; @@ -407,6 +407,9 @@ static int ad7266_probe(struct spi_device *spi) st->vref_mv = ret / 1000; } else { + /* Any other error indicates that the regulator does exist */ + if (PTR_ERR(st->reg) != -ENODEV) + return PTR_ERR(st->reg); /* Use internal reference */ st->vref_mv = 2500; } |