Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
[cascardo/linux.git] / drivers / media / common / tuners / tda8290.c
index 4b8662e..064d14c 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <linux/i2c.h>
 #include <linux/delay.h>
-#include <linux/videodev.h>
+#include <linux/videodev2.h>
 #include "tuner-i2c.h"
 #include "tda8290.h"
 #include "tda827x.h"
@@ -566,8 +566,11 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
        u8 data;
        struct i2c_msg msg = { .flags = I2C_M_RD, .buf = &data, .len = 1 };
 
-       if (NULL == analog_ops->i2c_gate_ctrl)
+       if (!analog_ops->i2c_gate_ctrl) {
+               printk(KERN_ERR "tda8290: no gate control were provided!\n");
+
                return -EINVAL;
+       }
 
        analog_ops->i2c_gate_ctrl(fe, 1);
 
@@ -615,11 +618,13 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
 
        if (ret != 1) {
                tuner_warn("tuner access failed!\n");
+               analog_ops->i2c_gate_ctrl(fe, 0);
                return -EREMOTEIO;
        }
 
        if ((data == 0x83) || (data == 0x84)) {
                priv->ver |= TDA18271;
+               tda829x_tda18271_config.config = priv->cfg.config;
                dvb_attach(tda18271_attach, fe, priv->tda827x_addr,
                           priv->i2c_props.adap, &tda829x_tda18271_config);
        } else {