aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-video.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-02-09 10:27:03 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:43 -0400
commitbefd6e645cc38eae0cfd4ef98b3daf0986240e2c (patch)
treeee718d6545e0041d6007503a9e0c98c93643d2ce /drivers/media/video/saa7134/saa7134-video.c
parent553d3c5067afceda3cdbfbf51c1e4a512a3b0627 (diff)
V4L/DVB (10511): saa7134: get rid of KBL
KBL is not needed on saa7134, so, let's remove it. However, we should take some care to avoid opening the module while initializing it. This issue exists with newer udev's that opens a device as soon as the driver is registered. So, a proper lock is needed on open. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index adfdb662c5eb..aa7fa1f73a56 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -1335,7 +1335,7 @@ static int video_open(struct file *file)
1335 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1335 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1336 int radio = 0; 1336 int radio = 0;
1337 1337
1338 lock_kernel(); 1338 mutex_lock(&saa7134_devlist_lock);
1339 list_for_each_entry(dev, &saa7134_devlist, devlist) { 1339 list_for_each_entry(dev, &saa7134_devlist, devlist) {
1340 if (dev->video_dev && (dev->video_dev->minor == minor)) 1340 if (dev->video_dev && (dev->video_dev->minor == minor))
1341 goto found; 1341 goto found;
@@ -1348,19 +1348,20 @@ static int video_open(struct file *file)
1348 goto found; 1348 goto found;
1349 } 1349 }
1350 } 1350 }
1351 unlock_kernel(); 1351 mutex_unlock(&saa7134_devlist_lock);
1352 return -ENODEV; 1352 return -ENODEV;
1353 found: 1353
1354found:
1355 mutex_unlock(&saa7134_devlist_lock);
1354 1356
1355 dprintk("open minor=%d radio=%d type=%s\n",minor,radio, 1357 dprintk("open minor=%d radio=%d type=%s\n",minor,radio,
1356 v4l2_type_names[type]); 1358 v4l2_type_names[type]);
1357 1359
1358 /* allocate + initialize per filehandle data */ 1360 /* allocate + initialize per filehandle data */
1359 fh = kzalloc(sizeof(*fh),GFP_KERNEL); 1361 fh = kzalloc(sizeof(*fh),GFP_KERNEL);
1360 if (NULL == fh) { 1362 if (NULL == fh)
1361 unlock_kernel();
1362 return -ENOMEM; 1363 return -ENOMEM;
1363 } 1364
1364 file->private_data = fh; 1365 file->private_data = fh;
1365 fh->dev = dev; 1366 fh->dev = dev;
1366 fh->radio = radio; 1367 fh->radio = radio;
@@ -1393,7 +1394,6 @@ static int video_open(struct file *file)
1393 /* switch to video/vbi mode */ 1394 /* switch to video/vbi mode */
1394 video_mux(dev,dev->ctl_input); 1395 video_mux(dev,dev->ctl_input);
1395 } 1396 }
1396 unlock_kernel();
1397 return 0; 1397 return 0;
1398} 1398}
1399 1399