]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
iio: dac: ad7303: fix error return code in ad7303_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 18 Jun 2013 13:08:00 +0000 (14:08 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sat, 29 Jun 2013 09:18:21 +0000 (10:18 +0100)
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/dac/ad7303.c

index 85aeef60dc5f6166a4f197677cab270867c11ec9..d546f50f9258b391891d0889c82cd0a826b959f0 100644 (file)
@@ -235,8 +235,10 @@ static int ad7303_probe(struct spi_device *spi)
 
        if (ext_ref) {
                st->vref_reg = regulator_get(&spi->dev, "REF");
-               if (IS_ERR(st->vref_reg))
+               if (IS_ERR(st->vref_reg)) {
+                       ret = PTR_ERR(st->vref_reg);
                        goto err_disable_vdd_reg;
+               }
 
                ret = regulator_enable(st->vref_reg);
                if (ret)