aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-xc2028.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/tuner-xc2028.c')
-rw-r--r--drivers/media/video/tuner-xc2028.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/media/video/tuner-xc2028.c b/drivers/media/video/tuner-xc2028.c
index a9caae1af49d..0b5ba67a4da5 100644
--- a/drivers/media/video/tuner-xc2028.c
+++ b/drivers/media/video/tuner-xc2028.c
@@ -1155,7 +1155,7 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
1155 if (debug) 1155 if (debug)
1156 printk(KERN_DEBUG "xc2028: Xcv2028/3028 init called!\n"); 1156 printk(KERN_DEBUG "xc2028: Xcv2028/3028 init called!\n");
1157 1157
1158 if (NULL == cfg || NULL == cfg->video_dev) 1158 if (NULL == cfg)
1159 return NULL; 1159 return NULL;
1160 1160
1161 if (!fe) { 1161 if (!fe) {
@@ -1163,13 +1163,19 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
1163 return NULL; 1163 return NULL;
1164 } 1164 }
1165 1165
1166 video_dev = cfg->video_dev; 1166 video_dev = cfg->i2c_adap->algo_data;
1167
1168 if (debug)
1169 printk(KERN_DEBUG "xc2028: video_dev =%p\n", video_dev);
1167 1170
1168 mutex_lock(&xc2028_list_mutex); 1171 mutex_lock(&xc2028_list_mutex);
1169 1172
1170 list_for_each_entry(priv, &xc2028_list, xc2028_list) { 1173 list_for_each_entry(priv, &xc2028_list, xc2028_list) {
1171 if (priv->video_dev == cfg->video_dev) { 1174 if (&priv->i2c_props.adap->dev == &cfg->i2c_adap->dev) {
1172 video_dev = NULL; 1175 video_dev = NULL;
1176 if (debug)
1177 printk(KERN_DEBUG "xc2028: reusing device\n");
1178
1173 break; 1179 break;
1174 } 1180 }
1175 } 1181 }
@@ -1197,6 +1203,9 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
1197 fe->tuner_priv = priv; 1203 fe->tuner_priv = priv;
1198 priv->count++; 1204 priv->count++;
1199 1205
1206 if (debug)
1207 printk(KERN_DEBUG "xc2028: usage count is %i\n", priv->count);
1208
1200 memcpy(&fe->ops.tuner_ops, &xc2028_dvb_tuner_ops, 1209 memcpy(&fe->ops.tuner_ops, &xc2028_dvb_tuner_ops,
1201 sizeof(xc2028_dvb_tuner_ops)); 1210 sizeof(xc2028_dvb_tuner_ops));
1202 1211