iio:adc: ad7766: testing the wrong variable in probe
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 10 Nov 2016 19:30:18 +0000 (22:30 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sat, 12 Nov 2016 14:35:21 +0000 (14:35 +0000)
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>
drivers/iio/adc/ad7766.c

index d906686c48eb1af8875b011ec86c3fcb7eeecf8c..75cca42b6e70cb548e4e4a60a3e21f4b3ba9f301 100644 (file)
@@ -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);