Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be2b85a13543bbaf1a141b3a54f84c1e3b059e69
Commit:     be2b85a13543bbaf1a141b3a54f84c1e3b059e69
Parent:     9ee476a56c3ee119a02b6823659f5698b1241f04
Author:     Michael Krufky <[EMAIL PROTECTED]>
AuthorDate: Mon Jun 4 14:40:27 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Wed Jul 18 14:23:54 2007 -0300

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/tuner-core.c |    5 +++++
 include/media/tuner.h            |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 4369f6d..0e71a22 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;
diff --git a/include/media/tuner.h b/include/media/tuner.h
index b901373..da821a0 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -215,6 +215,7 @@ struct tuner {
        int  (*get_afc)(struct i2c_client *c);
        void (*tuner_status)(struct i2c_client *c);
        void (*standby)(struct i2c_client *c);
+       void (*release)(struct i2c_client *c);
 };
 
 extern unsigned const int tuner_count;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to