diff options
author | Axel Lin | 2012-12-14 07:48:00 +0000 |
---|---|---|
committer | Jonathan Cameron | 2012-12-27 11:00:08 +0000 |
commit | 272cc9c8b5d0dffe9fb03e6c0ab3da2fde9c20e9 (patch) | |
tree | 02c2eb8f4844da0f695bffda4ddead4d2aa98008 /drivers/iio | |
parent | 36ce0c1c3ab7ea54fa6c2b3a0803c7ab0adcefbf (diff) |
iio: dac: ad5380: Don't set error code to st->vref
regulator_get_voltage() may return negative error code.
Add error checking to avoid setting error code to st->vref_uv.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/dac/ad5380.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c index 14991ac55f26..4aca1895ce52 100644 --- a/drivers/iio/dac/ad5380.c +++ b/drivers/iio/dac/ad5380.c @@ -406,7 +406,11 @@ static int __devinit ad5380_probe(struct device *dev, struct regmap *regmap, goto error_free_reg; } - st->vref = regulator_get_voltage(st->vref_reg); + ret = regulator_get_voltage(st->vref_reg); + if (ret < 0) + goto error_disable_reg; + + st->vref = ret; } else { st->vref = st->chip_info->int_vref; ctrl |= AD5380_CTRL_INT_VREF_EN; |