diff options
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/tuner-core.c | 7 | ||||
-rw-r--r-- | linux/include/media/tuner.h | 1 |
2 files changed, 6 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; diff --git a/linux/include/media/tuner.h b/linux/include/media/tuner.h index 3fd51b6ae..1f61f4681 100644 --- a/linux/include/media/tuner.h +++ b/linux/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; |