V4L/DVB (9394): cache last successful state
authorManu Abraham <abraham.manu@gmail.com>
Sat, 22 Sep 2007 16:36:34 +0000 (13:36 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 29 Dec 2008 19:53:15 +0000 (17:53 -0200)
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/tda8261.c

index dc7dc025ceb7abb9578f52d8a90b1bef853ba753..616d88b07158fe688beb838867b882243428f8e2 100644 (file)
@@ -143,10 +143,12 @@ static int tda8261_set_state(struct dvb_frontend *fe,
                        printk("%s: I/O Error\n", __func__);
                        return err;
                }
-               if (status == 1)
+               if (status == 1) {
                        printk("%s: Tuner Phase locked: status=%d\n", __func__, status);
-               else
+                       state->frequency = frequency; /* cache last successful */
+               } else {
                        printk("%s: No Phase lock: status=%d\n", __func__, status);
+               }
        } else {
                printk("%s: Unknown parameter (param=%d)\n", __func__, param);
                return -EINVAL;