]> err.no Git - linux-2.6/commitdiff
V4L/DVB (5742): Tuner: define release callback for mt20xx, tda9887 and tda8290
authorMichael Krufky <mkrufky@linuxtv.org>
Mon, 4 Jun 2007 18:20:11 +0000 (15:20 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 18 Jul 2007 17:23:55 +0000 (14:23 -0300)
Define tuner release callbacks for mt20xx, tda9887 and tda8290, so that
these drivers can release their own private structures themselves.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/mt20xx.c
drivers/media/video/tda8290.c
drivers/media/video/tda9887.c

index d7e68a639cd836b14e657393d87650112defb2ba..5b33be8a49cda30c88a1919e754b4679ca94a4ba 100644 (file)
@@ -495,6 +495,14 @@ static int mt2050_init(struct i2c_client *c)
        return 0;
 }
 
+static void microtune_release(struct i2c_client *c)
+{
+       struct tuner *t = i2c_get_clientdata(c);
+
+       kfree(t->priv);
+       t->priv = NULL;
+}
+
 int microtune_init(struct i2c_client *c)
 {
        struct microtune_priv *priv = NULL;
@@ -514,6 +522,7 @@ int microtune_init(struct i2c_client *c)
        t->set_tv_freq    = NULL;
        t->set_radio_freq = NULL;
        t->standby    = NULL;
+       t->release        = microtune_release;
        if (t->std & V4L2_STD_525_60) {
                tuner_dbg("pinnacle ntsc\n");
                priv->radio_if2 = 41300 * 1000;
index 7bdf968bf6e54828c496b78b9951902c4780fe45..2614ea99a9c3054d109b9bcdd8608bbee159106b 100644 (file)
@@ -595,6 +595,14 @@ static void tda8290_init_tuner(struct i2c_client *c)
 
 /*---------------------------------------------------------------------*/
 
+static void tda8290_release(struct i2c_client *c)
+{
+       struct tuner *t = i2c_get_clientdata(c);
+
+       kfree(t->priv);
+       t->priv = NULL;
+}
+
 int tda8290_init(struct i2c_client *c)
 {
        struct tda8290_priv *priv = NULL;
@@ -663,6 +671,7 @@ int tda8290_init(struct i2c_client *c)
        t->set_radio_freq = set_radio_freq;
        t->has_signal = has_signal;
        t->standby = standby;
+       t->release = tda8290_release;
        priv->tda827x_lpsel = 0;
        t->mode = V4L2_TUNER_ANALOG_TV;
 
index 01f18b07d013b145e2fa9495910c2f080da6568f..f0443cc02e5c48ebc21a15cef67b91e262a62c10 100644 (file)
@@ -591,6 +591,14 @@ static void tda9887_set_freq(struct i2c_client *client, unsigned int freq)
        tda9887_configure(client);
 }
 
+static void tda9887_release(struct i2c_client *c)
+{
+       struct tuner *t = i2c_get_clientdata(c);
+
+       kfree(t->priv);
+       t->priv = NULL;
+}
+
 int tda9887_tuner_init(struct i2c_client *c)
 {
        struct tda9887_priv *priv = NULL;
@@ -611,6 +619,7 @@ int tda9887_tuner_init(struct i2c_client *c)
        t->standby = tda9887_standby;
        t->tuner_status = tda9887_tuner_status;
        t->get_afc = tda9887_get_afc;
+       t->release = tda9887_release;
 
        return 0;
 }