aboutsummaryrefslogtreecommitdiffstats
path: root/src/tuner_e4k.c
diff options
context:
space:
mode:
authorSteve Markgraf <steve@steve-m.de>2012-05-05 02:19:34 +0200
committerSteve Markgraf <steve@steve-m.de>2012-05-05 02:19:34 +0200
commit59198d63422685470f52f633251d3859104de5b0 (patch)
tree00a0659db6fadcca35812bf96b6a95a59da3de7b /src/tuner_e4k.c
parent86c34428aabebc79ac0de7f1194e6b755a6fa213 (diff)
tuner_e4k: fix off-by-one error in e4k_if_gain_set()
Thanks to patchvonbraun for providing debug logs that helped to track this beast down. Signed-off-by: Steve Markgraf <steve@steve-m.de>
Diffstat (limited to 'src/tuner_e4k.c')
-rw-r--r--src/tuner_e4k.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tuner_e4k.c b/src/tuner_e4k.c
index b530812..08b812a 100644
--- a/src/tuner_e4k.c
+++ b/src/tuner_e4k.c
@@ -715,7 +715,7 @@ int e4k_if_gain_set(struct e4k_state *e4k, uint8_t stage, int8_t value)
return rc;
/* compute the bit-mask for the given gain field */
- field = &if_stage_gain_regs[stage];
+ field = &if_stage_gain_regs[stage-1];
mask = width2mask[field->width] << field->shift;
return e4k_reg_set_mask(e4k, field->reg, mask, rc << field->shift);