summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-06-04 13:40:27 -0400
committerMichael Krufky <mkrufky@linuxtv.org>2007-06-04 13:40:27 -0400
commit775f85f9f968985c9b5c9e6df137575a118fdf76 (patch)
treefc729a89ca29bece16966c503f1c5e3201f44157 /linux/drivers/media/video
parent5995e11bd1bb0f7f002da47b3157c837af8d10de (diff)
downloadmediapointer-dvb-s2-775f85f9f968985c9b5c9e6df137575a118fdf76.tar.gz
mediapointer-dvb-s2-775f85f9f968985c9b5c9e6df137575a118fdf76.tar.bz2
tuner: add release callback
From: Michael Krufky <mkrufky@linuxtv.org> Individual tuner drivers are now allocating memory themselves for their own private data structures. This changeset adds a release callback to the tuner operations, so that newer drivers that may require more complex data structures may release this private data themselves. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/tuner-core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index 969890f90..d2c946e2a 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -204,11 +204,12 @@ static void set_type(struct i2c_client *c, unsigned int type,
}
#endif
-#if 1
/* discard private data, in case set_type() was previously called */
+ if (t->release)
+ t->release(c);
kfree(t->priv);
t->priv = NULL;
-#endif
+
switch (t->type) {
case TUNER_MT2032:
microtune_init(c);
@@ -620,6 +621,8 @@ static int tuner_detach(struct i2c_client *client)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
MOD_DEC_USE_COUNT;
#endif
+ if (t->release)
+ t->release(client);
kfree(t->priv);
#if 0
t->priv = NULL;