From: Dan Carpenter Date: Thu, 10 Nov 2016 19:30:18 +0000 (+0300) Subject: iio:adc: ad7766: testing the wrong variable in probe X-Git-Tag: kvm-4.10-2~20^2~229^2~41 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0d8391f3d60f0b544951b4014f433b4c068da293;p=users%2Fdwmw2%2Flinux.git 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 Acked-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c index d906686c48eb1..75cca42b6e70c 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);