diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-11-10 22:30:18 +0300 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-11-12 17:35:21 +0300 |
commit | 0d8391f3d60f0b544951b4014f433b4c068da293 (patch) | |
tree | 1904f769eb1df44685ec596fcc34eb4e1f64ef49 /drivers/iio | |
parent | b548674ea78417a470a12416eebe016f93e460c0 (diff) | |
download | linux-0d8391f3d60f0b544951b4014f433b4c068da293.tar.xz |
iio:adc: ad7766: testing the wrong variable in probe
We should be testing "ret" here.
Fixes: aa16c6bd0e09 ("iio:adc: Add support for AD7766/AD7767")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/adc/ad7766.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c index d906686c48eb..75cca42b6e70 100644 --- a/drivers/iio/adc/ad7766.c +++ b/drivers/iio/adc/ad7766.c @@ -239,8 +239,8 @@ static int ad7766_probe(struct spi_device *spi) ret = devm_regulator_bulk_get(&spi->dev, ARRAY_SIZE(ad7766->reg), ad7766->reg); - if (IS_ERR(ad7766->reg)) - return PTR_ERR(ad7766->reg); + if (ret) + return ret; ad7766->pd_gpio = devm_gpiod_get_optional(&spi->dev, "powerdown", GPIOD_OUT_HIGH); |