summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-05-29 21:54:06 -0400
committerMichael Krufky <mkrufky@linuxtv.org>2007-05-29 21:54:06 -0400
commit5995e11bd1bb0f7f002da47b3157c837af8d10de (patch)
tree1d63cc6e7febc3d1381a52ec1d01552c1a046910 /linux/drivers/media/video/tuner-core.c
parent72df405254aa20ea12fe0c79a1d2eca5c65f70f1 (diff)
downloadmediapointer-dvb-s2-5995e11bd1bb0f7f002da47b3157c837af8d10de.tar.gz
mediapointer-dvb-s2-5995e11bd1bb0f7f002da47b3157c837af8d10de.tar.bz2
tuner: Move device-specific private data out of tuner struct
From: Michael Krufky <mkrufky@linuxtv.org> Create private data struct for device specific private data. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/video/tuner-core.c')
-rw-r--r--linux/drivers/media/video/tuner-core.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index e7bc60a5e..969890f90 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -204,6 +204,11 @@ static void set_type(struct i2c_client *c, unsigned int type,
}
#endif
+#if 1
+ /* discard private data, in case set_type() was previously called */
+ kfree(t->priv);
+ t->priv = NULL;
+#endif
switch (t->type) {
case TUNER_MT2032:
microtune_init(c);
@@ -496,7 +501,6 @@ static int tuner_attach(struct i2c_adapter *adap, int addr,
memcpy(&t->i2c, &client_template, sizeof(struct i2c_client));
i2c_set_clientdata(&t->i2c, t);
t->type = UNSET;
- t->radio_if2 = 10700 * 1000; /* 10.7MHz - FM radio */
t->audmode = V4L2_TUNER_MODE_STEREO;
t->mode_mask = T_UNINITIALIZED;
t->tuner_status = tuner_status;
@@ -616,6 +620,10 @@ static int tuner_detach(struct i2c_client *client)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
MOD_DEC_USE_COUNT;
#endif
+ kfree(t->priv);
+#if 0
+ t->priv = NULL;
+#endif
kfree(t);
return 0;
}