Merge tag 'vfio-v3.9-rc7' of git://github.com/awilliam/linux-vfio
[firefly-linux-kernel-4.4.55.git] / drivers / iio / dac / ad5380.c
index 6c7898c765d9599cb5a531a709c45d9a6a4944b0..483fc379a2da9ca64a29fb13313b16f3d76d8b43 100644 (file)
@@ -406,7 +406,11 @@ static int 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;