Skip to content

Commit

Permalink
iio: dac: ad7303: fix error return code in ad7303_probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Jonathan Cameron committed Jun 29, 2013
1 parent 0ad1ea6 commit 94fccb7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/iio/dac/ad7303.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 94fccb7

Please sign in to comment.