summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media')
-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;