summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorOliver Endriss <o.endriss@gmx.de>2010-01-10 15:39:45 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 15:10:38 -0300
commit41894b97009adcabc51c6a4943045fd944c46236 (patch)
treed2f0bb28826c8387c60fde1b964988ec55af4220 /drivers/media
parent2c1f750ba3fbd4a54544a68b57087bb89f3ba92c (diff)
downloadlinux-3.10-41894b97009adcabc51c6a4943045fd944c46236.tar.gz
linux-3.10-41894b97009adcabc51c6a4943045fd944c46236.tar.bz2
linux-3.10-41894b97009adcabc51c6a4943045fd944c46236.zip
V4L/DVB (13987): [STV090x] Quit processing if the tuner did not lock
Exit stv090x_algo() if the tuner did not lock. This might happen due to missing signal or invalid/incomplete tuning parameters. Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Manu Abraham <abraham.manu@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/stv090x.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c
index cc487f6bdce..a5bae404701 100644
--- a/drivers/media/dvb/frontends/stv090x.c
+++ b/drivers/media/dvb/frontends/stv090x.c
@@ -3256,21 +3256,21 @@ static enum stv090x_signal_state stv090x_algo(struct stv090x_state *state)
msleep(50);
- if (stv090x_i2c_gate_ctrl(fe, 1) < 0)
- goto err;
-
if (state->config->tuner_get_status) {
+ if (stv090x_i2c_gate_ctrl(fe, 1) < 0)
+ goto err;
if (state->config->tuner_get_status(fe, &reg) < 0)
goto err_gateoff;
- }
-
- if (reg)
- dprintk(FE_DEBUG, 1, "Tuner phase locked");
- else
- dprintk(FE_DEBUG, 1, "Tuner unlocked");
+ if (stv090x_i2c_gate_ctrl(fe, 0) < 0)
+ goto err;
- if (stv090x_i2c_gate_ctrl(fe, 0) < 0)
- goto err;
+ if (reg)
+ dprintk(FE_DEBUG, 1, "Tuner phase locked");
+ else {
+ dprintk(FE_DEBUG, 1, "Tuner unlocked");
+ return STV090x_NOCARRIER;
+ }
+ }
msleep(10);
agc1_power = MAKEWORD16(STV090x_READ_DEMOD(state, AGCIQIN1),