summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-06-18 14:08:00 +0100
committerJonathan Cameron <jic23@kernel.org>2013-06-29 10:18:21 +0100
commit94fccb78414a87f3c4bc7049ff8b6e80156944d9 (patch)
treed3645903037cb92017e61e920731bc599f01e13a
parent0ad1ea69545b1965be4c93ee03fdc685c6beb23d (diff)
downloadlinux-94fccb78414a87f3c4bc7049ff8b6e80156944d9.tar.gz
linux-94fccb78414a87f3c4bc7049ff8b6e80156944d9.tar.bz2
linux-94fccb78414a87f3c4bc7049ff8b6e80156944d9.zip
iio: dac: ad7303: fix error return code in ad7303_probe()
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>
-rw-r--r--drivers/iio/dac/ad7303.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/dac/ad7303.c b/drivers/iio/dac/ad7303.c
index 85aeef60dc5f..d546f50f9258 100644
--- a/drivers/iio/dac/ad7303.c
+++ b/drivers/iio/dac/ad7303.c
@@ -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)