X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=drivers%2Fmedia%2Fcommon%2Ftuners%2Ftda8290.c;h=064d14c8d7b294fbf218b34d0477455868a3fc13;hb=395d73413c5656c6d7706ae91dcb441f9b7e3074;hp=4b8662edb7cb48d6b4e73833241bc8b88bacbef1;hpb=cd764695b67386a81964f68e9c66efd9f13f4d29;p=cascardo%2Flinux.git diff --git a/drivers/media/common/tuners/tda8290.c b/drivers/media/common/tuners/tda8290.c index 4b8662edb7cb..064d14c8d7b2 100644 --- a/drivers/media/common/tuners/tda8290.c +++ b/drivers/media/common/tuners/tda8290.c @@ -22,7 +22,7 @@ #include #include -#include +#include #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 {