aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/stv090x.c
diff options
context:
space:
mode:
authorAndreas Regel <andreas.regel@gmx.de>2009-04-23 13:58:36 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 17:20:41 -0400
commit9629c5b69dd016e990603fd7fd9899f0af57610c (patch)
treefb9b22206f001f12179bca66b283ab929853e365 /drivers/media/dvb/frontends/stv090x.c
parent94871465b6a82de3882a61bf1e3c202725688294 (diff)
V4L/DVB (11597): stv090x: fixes read_status to return 0 in case of no error
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/stv090x.c')
-rw-r--r--drivers/media/dvb/frontends/stv090x.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c
index 004b774f561c..6c0378ddebc5 100644
--- a/drivers/media/dvb/frontends/stv090x.c
+++ b/drivers/media/dvb/frontends/stv090x.c
@@ -3163,7 +3163,6 @@ static int stv090x_read_status(struct dvb_frontend *fe, enum fe_status *status)
3163 struct stv090x_state *state = fe->demodulator_priv; 3163 struct stv090x_state *state = fe->demodulator_priv;
3164 u32 reg; 3164 u32 reg;
3165 u8 search_state; 3165 u8 search_state;
3166 int locked = 0;
3167 3166
3168 reg = STV090x_READ_DEMOD(state, DMDSTATE); 3167 reg = STV090x_READ_DEMOD(state, DMDSTATE);
3169 search_state = STV090x_GETFIELD_Px(reg, HEADER_MODE_FIELD); 3168 search_state = STV090x_GETFIELD_Px(reg, HEADER_MODE_FIELD);
@@ -3173,7 +3172,7 @@ static int stv090x_read_status(struct dvb_frontend *fe, enum fe_status *status)
3173 case 1: /* first PLH detected */ 3172 case 1: /* first PLH detected */
3174 default: 3173 default:
3175 dprintk(FE_DEBUG, 1, "Status: Unlocked (Searching ..)"); 3174 dprintk(FE_DEBUG, 1, "Status: Unlocked (Searching ..)");
3176 locked = 0; 3175 *status = 0;
3177 break; 3176 break;
3178 3177
3179 case 2: /* DVB-S2 mode */ 3178 case 2: /* DVB-S2 mode */
@@ -3182,7 +3181,6 @@ static int stv090x_read_status(struct dvb_frontend *fe, enum fe_status *status)
3182 if (STV090x_GETFIELD_Px(reg, LOCK_DEFINITIF_FIELD)) { 3181 if (STV090x_GETFIELD_Px(reg, LOCK_DEFINITIF_FIELD)) {
3183 reg = STV090x_READ_DEMOD(state, TSSTATUS); 3182 reg = STV090x_READ_DEMOD(state, TSSTATUS);
3184 if (STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD)) { 3183 if (STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD)) {
3185 locked = 1;
3186 *status = FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK; 3184 *status = FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK;
3187 } 3185 }
3188 } 3186 }
@@ -3196,7 +3194,6 @@ static int stv090x_read_status(struct dvb_frontend *fe, enum fe_status *status)
3196 if (STV090x_GETFIELD_Px(reg, LOCKEDVIT_FIELD)) { 3194 if (STV090x_GETFIELD_Px(reg, LOCKEDVIT_FIELD)) {
3197 reg = STV090x_READ_DEMOD(state, TSSTATUS); 3195 reg = STV090x_READ_DEMOD(state, TSSTATUS);
3198 if (STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD)) { 3196 if (STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD)) {
3199 locked = 1;
3200 *status = FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK; 3197 *status = FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK;
3201 } 3198 }
3202 } 3199 }
@@ -3204,7 +3201,7 @@ static int stv090x_read_status(struct dvb_frontend *fe, enum fe_status *status)
3204 break; 3201 break;
3205 } 3202 }
3206 3203
3207 return locked; 3204 return 0;
3208} 3205}
3209 3206
3210static int stv090x_read_per(struct dvb_frontend *fe, u32 *per) 3207static int stv090x_read_per(struct dvb_frontend *fe, u32 *per)
@@ -3215,7 +3212,8 @@ static int stv090x_read_per(struct dvb_frontend *fe, u32 *per)
3215 u32 reg, h, m, l; 3212 u32 reg, h, m, l;
3216 enum fe_status status; 3213 enum fe_status status;
3217 3214
3218 if (!stv090x_read_status(fe, &status)) { 3215 stv090x_read_status(fe, &status);
3216 if (!(status & FE_HAS_LOCK)) {
3219 *per = 1 << 23; /* Max PER */ 3217 *per = 1 << 23; /* Max PER */
3220 } else { 3218 } else {
3221 /* Counter 2 */ 3219 /* Counter 2 */