X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Ftda8290.c;h=55bc89a6f0694c7f3d8e35e6804f4fb8d01eda5f;hb=ef3f2de2b5496f721b12f21a157e19eac816394b;hp=54d261a2f25a3741ab9d7ceb010c3e9e169c38ea;hpb=255b5113b4ed683898a24e381155c081f03411f7;p=linux-2.6 diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c index 54d261a2f2..55bc89a6f0 100644 --- a/drivers/media/video/tda8290.c +++ b/drivers/media/video/tda8290.c @@ -502,13 +502,22 @@ static void tda8290_init_tuner(struct dvb_frontend *fe) static void tda829x_release(struct dvb_frontend *fe) { - if (fe->ops.tuner_ops.release) - fe->ops.tuner_ops.release(fe); + struct tda8290_priv *priv = fe->analog_demod_priv; + + /* only try to release the tuner if we've + * attached it from within this module */ + if (priv->ver & (TDA18271 | TDA8275 | TDA8275A)) + if (fe->ops.tuner_ops.release) + fe->ops.tuner_ops.release(fe); kfree(fe->analog_demod_priv); fe->analog_demod_priv = NULL; } +static struct tda18271_config tda829x_tda18271_config = { + .gate = TDA18271_GATE_ANALOG, +}; + static int tda829x_find_tuner(struct dvb_frontend *fe) { struct tda8290_priv *priv = fe->analog_demod_priv; @@ -574,7 +583,7 @@ static int tda829x_find_tuner(struct dvb_frontend *fe) priv->ver |= TDA18271; tda18271_attach(fe, priv->tda827x_addr, priv->i2c_props.adap, - TDA18271_GATE_ANALOG); + &tda829x_tda18271_config); } else { if ((data & 0x3c) == 0) priv->ver |= TDA8275; @@ -636,9 +645,6 @@ static int tda8295_probe(struct tuner_i2c_props *i2c_props) } static struct analog_demod_ops tda8290_ops = { - .info = { - .name = "TDA8290", - }, .set_params = tda8290_set_params, .has_signal = tda8290_has_signal, .standby = tda8290_standby, @@ -647,9 +653,6 @@ static struct analog_demod_ops tda8290_ops = { }; static struct analog_demod_ops tda8295_ops = { - .info = { - .name = "TDA8295", - }, .set_params = tda8295_set_params, .has_signal = tda8295_has_signal, .standby = tda8295_standby, @@ -722,6 +725,8 @@ struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe, } tuner_info("type set to %s\n", name); + fe->ops.analog_ops.info.name = name; + if (priv->ver & TDA8290) { tda8290_init_tuner(fe); tda8290_init_if(fe);