aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-06-04 14:40:27 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-18 14:23:54 -0300
commitbe2b85a13543bbaf1a141b3a54f84c1e3b059e69 (patch)
tree9f44d2aa513237b5baab578a51f66a4d2e731b6c /drivers/media/video
parent9ee476a56c3ee119a02b6823659f5698b1241f04 (diff)
V4L/DVB (5741): Tuner: add release callback
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/tuner-core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 4369f6d1249..0e71a22f1d4 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -178,8 +178,11 @@ static void set_type(struct i2c_client *c, unsigned int type,
}
/* discard private data, in case set_type() was previously called */
+ if (t->release)
+ t->release(c);
kfree(t->priv);
t->priv = NULL;
+
switch (t->type) {
case TUNER_MT2032:
microtune_init(c);
@@ -561,6 +564,8 @@ static int tuner_detach(struct i2c_client *client)
return err;
}
+ if (t->release)
+ t->release(client);
kfree(t->priv);
kfree(t);
return 0;