diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-11-01 22:05:41 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-11 19:04:50 +0100 |
commit | 01a26ff99ca4cec8dcb246683b4b44f5728f75c0 (patch) | |
tree | eadf45c7ac4ed823f70db039d1e8b59301e5f35b /drivers/media/tuners | |
parent | media: atmel-isc: avoid returning a random value at isc_parse_dt() (diff) | |
download | linux-01a26ff99ca4cec8dcb246683b4b44f5728f75c0.tar.xz linux-01a26ff99ca4cec8dcb246683b4b44f5728f75c0.zip |
media: tda8290: initialize agc gain
The tuning logic at tda8290 relies on agc_stat and
adc_sat to be initialized. However, as warned by smatch:
drivers/media/tuners/tda8290.c:261 tda8290_set_params() error: uninitialized symbol 'agc_stat'.
drivers/media/tuners/tda8290.c:261 tda8290_set_params() error: uninitialized symbol 'adc_sat'.
drivers/media/tuners/tda8290.c:262 tda8290_set_params() error: uninitialized symbol 'adc_sat'.
That could cause an erratic behavior if PLL is not locked,
as the code will only work if
!(pll_stat & 0x80) && (adc_sat < 20)
So, initialize it to zero, in order to let the code below
to be called, with should give more chances to adjust the
tuner gain, in order to get a PLL lock.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/tuners')
-rw-r--r-- | drivers/media/tuners/tda8290.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/tuners/tda8290.c b/drivers/media/tuners/tda8290.c index a59c567c55d6..f226e6ecc175 100644 --- a/drivers/media/tuners/tda8290.c +++ b/drivers/media/tuners/tda8290.c @@ -196,7 +196,7 @@ static void tda8290_set_params(struct dvb_frontend *fe, unsigned char addr_adc_sat = 0x1a; unsigned char addr_agc_stat = 0x1d; unsigned char addr_pll_stat = 0x1b; - unsigned char adc_sat, agc_stat, + unsigned char adc_sat = 0, agc_stat = 0, pll_stat; int i; |