media: mxl5xx: fix tuning logic
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 15 Oct 2017 18:54:52 +0000 (14:54 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 11 Dec 2017 18:04:33 +0000 (13:04 -0500)
The tuning logic is broken with regards to status report:
it relies on a previously-cached value that may not be valid
if re-tuned.

Change the logic to always read the status.

Acked-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-frontends/mxl5xx.c

index 53064e1..1ebc383 100644 (file)
@@ -636,16 +636,9 @@ static int tune(struct dvb_frontend *fe, bool re_tune,
                if (r)
                        return r;
                state->tune_time = jiffies;
-               return 0;
        }
-       if (*status & FE_HAS_LOCK)
-               return 0;
 
-       r = read_status(fe, status);
-       if (r)
-               return r;
-
-       return 0;
+       return read_status(fe, status);
 }
 
 static enum fe_code_rate conv_fec(enum MXL_HYDRA_FEC_E fec)