aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-05-29 21:54:06 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-18 13:23:48 -0400
commitb208319993ceff7ebfcc6bb914fe94d29e48a891 (patch)
tree0a0697806b221c7711914dbdfe2bd3972c206b23 /drivers/media/video/tuner-core.c
parent56584c9ea9a6dcd672f97ebfeebc4903e8b903bc (diff)
V4L/DVB (5719): Tuner: Move device-specific private data out of tuner struct
Create private data struct for device specific private data. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tuner-core.c')
-rw-r--r--drivers/media/video/tuner-core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 591ca9ce0440..406b85cd6064 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -177,6 +177,9 @@ static void set_type(struct i2c_client *c, unsigned int type,
177 return; 177 return;
178 } 178 }
179 179
180 /* discard private data, in case set_type() was previously called */
181 kfree(t->priv);
182 t->priv = NULL;
180 switch (t->type) { 183 switch (t->type) {
181 case TUNER_MT2032: 184 case TUNER_MT2032:
182 microtune_init(c); 185 microtune_init(c);
@@ -450,7 +453,6 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
450 memcpy(&t->i2c, &client_template, sizeof(struct i2c_client)); 453 memcpy(&t->i2c, &client_template, sizeof(struct i2c_client));
451 i2c_set_clientdata(&t->i2c, t); 454 i2c_set_clientdata(&t->i2c, t);
452 t->type = UNSET; 455 t->type = UNSET;
453 t->radio_if2 = 10700 * 1000; /* 10.7MHz - FM radio */
454 t->audmode = V4L2_TUNER_MODE_STEREO; 456 t->audmode = V4L2_TUNER_MODE_STEREO;
455 t->mode_mask = T_UNINITIALIZED; 457 t->mode_mask = T_UNINITIALIZED;
456 t->tuner_status = tuner_status; 458 t->tuner_status = tuner_status;
@@ -559,6 +561,7 @@ static int tuner_detach(struct i2c_client *client)
559 return err; 561 return err;
560 } 562 }
561 563
564 kfree(t->priv);
562 kfree(t); 565 kfree(t);
563 return 0; 566 return 0;
564} 567}