diff options
-rw-r--r-- | drivers/media/video/tuner-core.c | 5 | ||||
-rw-r--r-- | 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 4369f6d12499..0e71a22f1d4f 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, | |||
178 | } | 178 | } |
179 | 179 | ||
180 | /* discard private data, in case set_type() was previously called */ | 180 | /* discard private data, in case set_type() was previously called */ |
181 | if (t->release) | ||
182 | t->release(c); | ||
181 | kfree(t->priv); | 183 | kfree(t->priv); |
182 | t->priv = NULL; | 184 | t->priv = NULL; |
185 | |||
183 | switch (t->type) { | 186 | switch (t->type) { |
184 | case TUNER_MT2032: | 187 | case TUNER_MT2032: |
185 | microtune_init(c); | 188 | microtune_init(c); |
@@ -561,6 +564,8 @@ static int tuner_detach(struct i2c_client *client) | |||
561 | return err; | 564 | return err; |
562 | } | 565 | } |
563 | 566 | ||
567 | if (t->release) | ||
568 | t->release(client); | ||
564 | kfree(t->priv); | 569 | kfree(t->priv); |
565 | kfree(t); | 570 | kfree(t); |
566 | return 0; | 571 | return 0; |
diff --git a/include/media/tuner.h b/include/media/tuner.h index b901373c6e10..da821a027e76 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
@@ -215,6 +215,7 @@ struct tuner { | |||
215 | int (*get_afc)(struct i2c_client *c); | 215 | int (*get_afc)(struct i2c_client *c); |
216 | void (*tuner_status)(struct i2c_client *c); | 216 | void (*tuner_status)(struct i2c_client *c); |
217 | void (*standby)(struct i2c_client *c); | 217 | void (*standby)(struct i2c_client *c); |
218 | void (*release)(struct i2c_client *c); | ||
218 | }; | 219 | }; |
219 | 220 | ||
220 | extern unsigned const int tuner_count; | 221 | extern unsigned const int tuner_count; |