This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] fc0011: Add some sanity checks and cleanups
Author:  Michael Büsch <m...@bues.ch>
Date:    Thu Feb 7 12:19:30 2013 -0300

Add some sanity checks to the calculations and make the REG_16 register write 
consistent
with the other ones.

Signed-off-by: Michael Buesch <m...@bues.ch>
Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com>

 drivers/media/tuners/fc0011.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=aadb4640109b76cc9d0e1d8ce6b7bc3258a89170

diff --git a/drivers/media/tuners/fc0011.c b/drivers/media/tuners/fc0011.c
index f87aa5a..3932aa8 100644
--- a/drivers/media/tuners/fc0011.c
+++ b/drivers/media/tuners/fc0011.c
@@ -220,6 +220,7 @@ static int fc0011_set_params(struct dvb_frontend *fe)
 
        /* Calc XIN. The PLL reference frequency is 18 MHz. */
        xdiv = fvco / 18000;
+       WARN_ON(xdiv > 0xFF);
        frac = fvco - xdiv * 18000;
        frac = (frac << 15) / 18000;
        if (frac >= 16384)
@@ -346,6 +347,8 @@ static int fc0011_set_params(struct dvb_frontend *fe)
        vco_cal &= FC11_VCOCAL_VALUEMASK;
 
        switch (vco_sel) {
+       default:
+               WARN_ON(1);
        case 0:
                if (vco_cal < 8) {
                        regs[FC11_REG_VCOSEL] &= ~(FC11_VCOSEL_1 | 
FC11_VCOSEL_2);
@@ -427,7 +430,8 @@ static int fc0011_set_params(struct dvb_frontend *fe)
        err = fc0011_writereg(priv, FC11_REG_RCCAL, regs[FC11_REG_RCCAL]);
        if (err)
                return err;
-       err = fc0011_writereg(priv, FC11_REG_16, 0xB);
+       regs[FC11_REG_16] = 0xB;
+       err = fc0011_writereg(priv, FC11_REG_16, regs[FC11_REG_16]);
        if (err)
                return err;
 

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to