Commit 024cf530 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

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: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent be2b85a1
...@@ -495,6 +495,14 @@ static int mt2050_init(struct i2c_client *c) ...@@ -495,6 +495,14 @@ static int mt2050_init(struct i2c_client *c)
return 0; 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) int microtune_init(struct i2c_client *c)
{ {
struct microtune_priv *priv = NULL; struct microtune_priv *priv = NULL;
...@@ -514,6 +522,7 @@ int microtune_init(struct i2c_client *c) ...@@ -514,6 +522,7 @@ int microtune_init(struct i2c_client *c)
t->set_tv_freq = NULL; t->set_tv_freq = NULL;
t->set_radio_freq = NULL; t->set_radio_freq = NULL;
t->standby = NULL; t->standby = NULL;
t->release = microtune_release;
if (t->std & V4L2_STD_525_60) { if (t->std & V4L2_STD_525_60) {
tuner_dbg("pinnacle ntsc\n"); tuner_dbg("pinnacle ntsc\n");
priv->radio_if2 = 41300 * 1000; priv->radio_if2 = 41300 * 1000;
......
...@@ -595,6 +595,14 @@ static void tda8290_init_tuner(struct i2c_client *c) ...@@ -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) int tda8290_init(struct i2c_client *c)
{ {
struct tda8290_priv *priv = NULL; struct tda8290_priv *priv = NULL;
...@@ -663,6 +671,7 @@ int tda8290_init(struct i2c_client *c) ...@@ -663,6 +671,7 @@ int tda8290_init(struct i2c_client *c)
t->set_radio_freq = set_radio_freq; t->set_radio_freq = set_radio_freq;
t->has_signal = has_signal; t->has_signal = has_signal;
t->standby = standby; t->standby = standby;
t->release = tda8290_release;
priv->tda827x_lpsel = 0; priv->tda827x_lpsel = 0;
t->mode = V4L2_TUNER_ANALOG_TV; t->mode = V4L2_TUNER_ANALOG_TV;
......
...@@ -591,6 +591,14 @@ static void tda9887_set_freq(struct i2c_client *client, unsigned int freq) ...@@ -591,6 +591,14 @@ static void tda9887_set_freq(struct i2c_client *client, unsigned int freq)
tda9887_configure(client); 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) int tda9887_tuner_init(struct i2c_client *c)
{ {
struct tda9887_priv *priv = NULL; struct tda9887_priv *priv = NULL;
...@@ -611,6 +619,7 @@ int tda9887_tuner_init(struct i2c_client *c) ...@@ -611,6 +619,7 @@ int tda9887_tuner_init(struct i2c_client *c)
t->standby = tda9887_standby; t->standby = tda9887_standby;
t->tuner_status = tda9887_tuner_status; t->tuner_status = tda9887_tuner_status;
t->get_afc = tda9887_get_afc; t->get_afc = tda9887_get_afc;
t->release = tda9887_release;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment