summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-xc2028.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-03-25 14:33:20 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-03-25 14:33:20 -0300
commit129f9913b28a40d3215a7251caf0b2a4f9f2470b (patch)
tree1bc7a94728013fc90fc870107ebc393419603c4b /linux/drivers/media/video/tuner-xc2028.c
parent1737d06d9d3b77807244c3f0fdb1b6f62a201af0 (diff)
parent91cb86194d6146eb1da0f838116b5bc752a0c62d (diff)
downloadmediapointer-dvb-s2-129f9913b28a40d3215a7251caf0b2a4f9f2470b.tar.gz
mediapointer-dvb-s2-129f9913b28a40d3215a7251caf0b2a4f9f2470b.tar.bz2
merge: http://linuxtv.org/hg/~mkrufky/tda18271c2
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/tuner-xc2028.c')
-rw-r--r--linux/drivers/media/video/tuner-xc2028.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/linux/drivers/media/video/tuner-xc2028.c b/linux/drivers/media/video/tuner-xc2028.c
index bfa6ac740..5b443965b 100644
--- a/linux/drivers/media/video/tuner-xc2028.c
+++ b/linux/drivers/media/video/tuner-xc2028.c
@@ -1174,7 +1174,7 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
if (debug)
printk(KERN_DEBUG "xc2028: Xcv2028/3028 init called!\n");
- if (NULL == cfg || NULL == cfg->video_dev)
+ if (NULL == cfg)
return NULL;
if (!fe) {
@@ -1182,13 +1182,19 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
return NULL;
}
- video_dev = cfg->video_dev;
+ video_dev = cfg->i2c_adap->algo_data;
+
+ if (debug)
+ printk(KERN_DEBUG "xc2028: video_dev =%p\n", video_dev);
mutex_lock(&xc2028_list_mutex);
list_for_each_entry(priv, &xc2028_list, xc2028_list) {
- if (priv->video_dev == cfg->video_dev) {
+ if (&priv->i2c_props.adap->dev == &cfg->i2c_adap->dev) {
video_dev = NULL;
+ if (debug)
+ printk(KERN_DEBUG "xc2028: reusing device\n");
+
break;
}
}
@@ -1216,6 +1222,9 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
fe->tuner_priv = priv;
priv->count++;
+ if (debug)
+ printk(KERN_DEBUG "xc2028: usage count is %i\n", priv->count);
+
memcpy(&fe->ops.tuner_ops, &xc2028_dvb_tuner_ops,
sizeof(xc2028_dvb_tuner_ops));