media: dvb-frontends/stv0910: fix FE_HAS_LOCK check order in tune()
authorDaniel Scheller <d.scheller@gmx.net>
Sun, 20 Aug 2017 10:29:14 +0000 (06:29 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 20 Aug 2017 11:29:10 +0000 (07:29 -0400)
It should first read the status and then check if FE has lock.

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

index 45d94c3..e87a3ee 100644 (file)
@@ -1581,13 +1581,15 @@ static int tune(struct dvb_frontend *fe, bool re_tune,
                        return r;
                state->tune_time = jiffies;
        }
-       if (*status & FE_HAS_LOCK)
-               return 0;
-       *delay = HZ;
 
        r = read_status(fe, status);
        if (r)
                return r;
+
+       if (*status & FE_HAS_LOCK)
+               return 0;
+       *delay = HZ;
+
        return 0;
 }