summaryrefslogtreecommitdiffstats
path: root/drivers/iio/frequency/admv1013.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/frequency/admv1013.c')
-rw-r--r--drivers/iio/frequency/admv1013.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/iio/frequency/admv1013.c b/drivers/iio/frequency/admv1013.c
index cc01fac2dfee..6355c1f28423 100644
--- a/drivers/iio/frequency/admv1013.c
+++ b/drivers/iio/frequency/admv1013.c
@@ -344,9 +344,12 @@ static int admv1013_update_quad_filters(struct admv1013_state *st)
static int admv1013_update_mixer_vgate(struct admv1013_state *st)
{
- unsigned int vcm, mixer_vgate;
+ unsigned int mixer_vgate;
+ int vcm;
vcm = regulator_get_voltage(st->reg);
+ if (vcm < 0)
+ return vcm;
if (vcm < 1800000)
mixer_vgate = (2389 * vcm / 1000000 + 8100) / 100;