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>
This commit is contained in:
Steve Markgraf 2012-05-05 02:19:34 +02:00
parent 86c34428aa
commit 59198d6342
1 changed files with 1 additions and 1 deletions

View File

@ -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);