提交 272cc9c8 编写于 作者: A Axel Lin 提交者: Jonathan Cameron

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: NAxel Lin <axel.lin@ingics.com>
Acked-by: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 36ce0c1c
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册