[media] mb86a20s: Fix i2c gate on error
authorMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 14 Jan 2013 13:16:07 +0000 (10:16 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 22 Jan 2013 10:12:31 +0000 (08:12 -0200)
If an error happens, restore tuner I2C gate to the right
value.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb-frontends/mb86a20s.c

index 4ff3a0c9d977984d9129be0f4c78d7f019e6b94f..3c8587e38a05b20bb5a7bcde654af7a01cb87721 100644 (file)
@@ -262,10 +262,10 @@ static int mb86a20s_initfe(struct dvb_frontend *fe)
                        goto err;
        }
 
+err:
        if (fe->ops.i2c_gate_ctrl)
                fe->ops.i2c_gate_ctrl(fe, 1);
 
-err:
        if (rc < 0) {
                state->need_init = true;
                printk(KERN_INFO "mb86a20s: Init failed. Will try again later\n");
@@ -363,6 +363,10 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe)
 
        dprintk("\n");
 
+       /*
+        * Gate should already be opened, but it doesn't hurt to
+        * double-check
+        */
        if (fe->ops.i2c_gate_ctrl)
                fe->ops.i2c_gate_ctrl(fe, 1);
        dprintk("Calling tuner set parameters\n");