summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJemma Denson <jdenson@gmail.com>2016-02-28 15:29:50 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-03-03 14:26:55 -0300
commit035cad576d4e8c472a97b8913f92f73c93205fd3 (patch)
treeea7091bd2e45ab75793a8276305445ea8a0f65aa /drivers/media
parent565e37d168ee842c5f6349a5530f8e85651ec8e5 (diff)
downloadop-kernel-dev-035cad576d4e8c472a97b8913f92f73c93205fd3.zip
op-kernel-dev-035cad576d4e8c472a97b8913f92f73c93205fd3.tar.gz
[media] cx24120: make sure tuner is locked at get_frontend
Change get_frontend to re-check current lock status rather than relying on a cached value from get_status. Removes potential for tuning failure if get_frontend is called during tuning. Probably not too essential as other changes work around this: https://patchwork.linuxtv.org/patch/32845/ Signed-off-by: Jemma Denson <jdenson@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb-frontends/cx24120.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/cx24120.c b/drivers/media/dvb-frontends/cx24120.c
index 6ccbd86..066ee38 100644
--- a/drivers/media/dvb-frontends/cx24120.c
+++ b/drivers/media/dvb-frontends/cx24120.c
@@ -1507,11 +1507,13 @@ static int cx24120_get_frontend(struct dvb_frontend *fe,
{
struct cx24120_state *state = fe->demodulator_priv;
u8 freq1, freq2, freq3;
+ int status;
dev_dbg(&state->i2c->dev, "\n");
/* don't return empty data if we're not tuned in */
- if ((state->fe_status & FE_HAS_LOCK) == 0)
+ status = cx24120_readreg(state, CX24120_REG_STATUS);
+ if (!(status & CX24120_HAS_LOCK))
return 0;
/* Get frequency */
OpenPOWER on IntegriCloud