diff options
author | Manu Abraham <manu@linuxtv.org> | 2009-04-23 21:58:36 +0400 |
---|---|---|
committer | Manu Abraham <manu@linuxtv.org> | 2009-04-23 21:58:36 +0400 |
commit | fefe9f0c6dc0858fd05f26da9230beb27aba3663 (patch) | |
tree | 4ad3334043a03dfd8cf8dc595775131d55fa10f9 /linux/drivers/media/dvb/frontends/stv090x.c | |
parent | 646f510d1100149a70483eadcda550da9c8fa551 (diff) | |
download | mediapointer-dvb-s2-fefe9f0c6dc0858fd05f26da9230beb27aba3663.tar.gz mediapointer-dvb-s2-fefe9f0c6dc0858fd05f26da9230beb27aba3663.tar.bz2 |
Fixes read_status to return 0 in case of no error
From: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb/frontends/stv090x.c')
-rw-r--r-- | linux/drivers/media/dvb/frontends/stv090x.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/linux/drivers/media/dvb/frontends/stv090x.c b/linux/drivers/media/dvb/frontends/stv090x.c index 20efaf685..0635f3355 100644 --- a/linux/drivers/media/dvb/frontends/stv090x.c +++ b/linux/drivers/media/dvb/frontends/stv090x.c @@ -3948,7 +3948,6 @@ static int stv090x_read_status(struct dvb_frontend *fe, enum fe_status *status) struct stv090x_state *state = fe->demodulator_priv; u32 reg; u8 search_state; - int locked = 0; reg = STV090x_READ_DEMOD(state, DMDSTATE); search_state = STV090x_GETFIELD_Px(reg, HEADER_MODE_FIELD); @@ -3958,7 +3957,7 @@ static int stv090x_read_status(struct dvb_frontend *fe, enum fe_status *status) case 1: /* first PLH detected */ default: dprintk(FE_DEBUG, 1, "Status: Unlocked (Searching ..)"); - locked = 0; + *status = 0; break; case 2: /* DVB-S2 mode */ @@ -3967,7 +3966,6 @@ static int stv090x_read_status(struct dvb_frontend *fe, enum fe_status *status) if (STV090x_GETFIELD_Px(reg, LOCK_DEFINITIF_FIELD)) { reg = STV090x_READ_DEMOD(state, TSSTATUS); if (STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD)) { - locked = 1; *status = FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK; } } @@ -3981,7 +3979,6 @@ static int stv090x_read_status(struct dvb_frontend *fe, enum fe_status *status) if (STV090x_GETFIELD_Px(reg, LOCKEDVIT_FIELD)) { reg = STV090x_READ_DEMOD(state, TSSTATUS); if (STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD)) { - locked = 1; *status = FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK; } } @@ -3989,7 +3986,7 @@ static int stv090x_read_status(struct dvb_frontend *fe, enum fe_status *status) break; } - return locked; + return 0; } static int stv090x_read_per(struct dvb_frontend *fe, u32 *per) @@ -4000,7 +3997,8 @@ static int stv090x_read_per(struct dvb_frontend *fe, u32 *per) u32 reg, h, m, l; enum fe_status status; - if (!stv090x_read_status(fe, &status)) { + stv090x_read_status(fe, &status); + if (!(status & FE_HAS_LOCK)) { *per = 1 << 23; /* Max PER */ } else { /* Counter 2 */ |