aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-06-04 14:20:11 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-18 13:23:55 -0400
commit024cf53089f7c8e58934407f07ca2a7b5bed3b06 (patch)
tree81074f679f6fbbb74e8b78cd1c2dd9a4dcfff1cb /drivers/media
parentbe2b85a13543bbaf1a141b3a54f84c1e3b059e69 (diff)
V4L/DVB (5742): Tuner: define release callback for mt20xx, tda9887 and tda8290
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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/mt20xx.c9
-rw-r--r--drivers/media/video/tda8290.c9
-rw-r--r--drivers/media/video/tda9887.c9
3 files changed, 27 insertions, 0 deletions
diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c
index d7e68a639cd8..5b33be8a49cd 100644
--- a/drivers/media/video/mt20xx.c
+++ b/drivers/media/video/mt20xx.c
@@ -495,6 +495,14 @@ static int mt2050_init(struct i2c_client *c)
495 return 0; 495 return 0;
496} 496}
497 497
498static void microtune_release(struct i2c_client *c)
499{
500 struct tuner *t = i2c_get_clientdata(c);
501
502 kfree(t->priv);
503 t->priv = NULL;
504}
505
498int microtune_init(struct i2c_client *c) 506int microtune_init(struct i2c_client *c)
499{ 507{
500 struct microtune_priv *priv = NULL; 508 struct microtune_priv *priv = NULL;
@@ -514,6 +522,7 @@ int microtune_init(struct i2c_client *c)
514 t->set_tv_freq = NULL; 522 t->set_tv_freq = NULL;
515 t->set_radio_freq = NULL; 523 t->set_radio_freq = NULL;
516 t->standby = NULL; 524 t->standby = NULL;
525 t->release = microtune_release;
517 if (t->std & V4L2_STD_525_60) { 526 if (t->std & V4L2_STD_525_60) {
518 tuner_dbg("pinnacle ntsc\n"); 527 tuner_dbg("pinnacle ntsc\n");
519 priv->radio_if2 = 41300 * 1000; 528 priv->radio_if2 = 41300 * 1000;
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index 7bdf968bf6e5..2614ea99a9c3 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -595,6 +595,14 @@ static void tda8290_init_tuner(struct i2c_client *c)
595 595
596/*---------------------------------------------------------------------*/ 596/*---------------------------------------------------------------------*/
597 597
598static void tda8290_release(struct i2c_client *c)
599{
600 struct tuner *t = i2c_get_clientdata(c);
601
602 kfree(t->priv);
603 t->priv = NULL;
604}
605
598int tda8290_init(struct i2c_client *c) 606int tda8290_init(struct i2c_client *c)
599{ 607{
600 struct tda8290_priv *priv = NULL; 608 struct tda8290_priv *priv = NULL;
@@ -663,6 +671,7 @@ int tda8290_init(struct i2c_client *c)
663 t->set_radio_freq = set_radio_freq; 671 t->set_radio_freq = set_radio_freq;
664 t->has_signal = has_signal; 672 t->has_signal = has_signal;
665 t->standby = standby; 673 t->standby = standby;
674 t->release = tda8290_release;
666 priv->tda827x_lpsel = 0; 675 priv->tda827x_lpsel = 0;
667 t->mode = V4L2_TUNER_ANALOG_TV; 676 t->mode = V4L2_TUNER_ANALOG_TV;
668 677
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index 01f18b07d013..f0443cc02e5c 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -591,6 +591,14 @@ static void tda9887_set_freq(struct i2c_client *client, unsigned int freq)
591 tda9887_configure(client); 591 tda9887_configure(client);
592} 592}
593 593
594static void tda9887_release(struct i2c_client *c)
595{
596 struct tuner *t = i2c_get_clientdata(c);
597
598 kfree(t->priv);
599 t->priv = NULL;
600}
601
594int tda9887_tuner_init(struct i2c_client *c) 602int tda9887_tuner_init(struct i2c_client *c)
595{ 603{
596 struct tda9887_priv *priv = NULL; 604 struct tda9887_priv *priv = NULL;
@@ -611,6 +619,7 @@ int tda9887_tuner_init(struct i2c_client *c)
611 t->standby = tda9887_standby; 619 t->standby = tda9887_standby;
612 t->tuner_status = tda9887_tuner_status; 620 t->tuner_status = tda9887_tuner_status;
613 t->get_afc = tda9887_get_afc; 621 t->get_afc = tda9887_get_afc;
622 t->release = tda9887_release;
614 623
615 return 0; 624 return 0;
616} 625}