aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s2255drv.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-07-30 07:43:36 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:36:47 -0400
commitd56dc61265d2527a63ab5b0f03199a43cd89ca36 (patch)
treebea2a5b12fc120ca6e8797b2f16ad9696e0f25dd /drivers/media/video/s2255drv.c
parent95f73c5b57990c97047c200b8746ab62a360c5bc (diff)
V4L/DVB (8613): v4l: move BKL down to the driver level.
The BKL is now moved from the video_open function in v4l2-dev.c to the various drivers. It seems about a third of the drivers already has a lock of some sort protecting the open(), another third uses video_exclusive_open (yuck!) and the last third required adding the BKL in their open function. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s2255drv.c')
-rw-r--r--drivers/media/video/s2255drv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index 92b83feae366..de39cf0890fc 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -1457,6 +1457,7 @@ static int s2255_open(struct inode *inode, struct file *file)
1457 int cur_channel = -1; 1457 int cur_channel = -1;
1458 dprintk(1, "s2255: open called (minor=%d)\n", minor); 1458 dprintk(1, "s2255: open called (minor=%d)\n", minor);
1459 1459
1460 lock_kernel();
1460 list_for_each(list, &s2255_devlist) { 1461 list_for_each(list, &s2255_devlist) {
1461 h = list_entry(list, struct s2255_dev, s2255_devlist); 1462 h = list_entry(list, struct s2255_dev, s2255_devlist);
1462 for (i = 0; i < MAX_CHANNELS; i++) { 1463 for (i = 0; i < MAX_CHANNELS; i++) {
@@ -1469,6 +1470,7 @@ static int s2255_open(struct inode *inode, struct file *file)
1469 } 1470 }
1470 1471
1471 if ((NULL == dev) || (cur_channel == -1)) { 1472 if ((NULL == dev) || (cur_channel == -1)) {
1473 unlock_kernel();
1472 dprintk(1, "s2255: openv4l no dev\n"); 1474 dprintk(1, "s2255: openv4l no dev\n");
1473 return -ENODEV; 1475 return -ENODEV;
1474 } 1476 }
@@ -1490,6 +1492,7 @@ static int s2255_open(struct inode *inode, struct file *file)
1490 printk(KERN_INFO "2255 FW load failed.\n"); 1492 printk(KERN_INFO "2255 FW load failed.\n");
1491 dev->users[cur_channel]--; 1493 dev->users[cur_channel]--;
1492 mutex_unlock(&dev->open_lock); 1494 mutex_unlock(&dev->open_lock);
1495 unlock_kernel();
1493 return -EFAULT; 1496 return -EFAULT;
1494 } 1497 }
1495 } else if (atomic_read(&dev->fw_data->fw_state) == S2255_FW_NOTLOADED) { 1498 } else if (atomic_read(&dev->fw_data->fw_state) == S2255_FW_NOTLOADED) {
@@ -1506,6 +1509,7 @@ static int s2255_open(struct inode *inode, struct file *file)
1506 "try again\n"); 1509 "try again\n");
1507 dev->users[cur_channel]--; 1510 dev->users[cur_channel]--;
1508 mutex_unlock(&dev->open_lock); 1511 mutex_unlock(&dev->open_lock);
1512 unlock_kernel();
1509 return -EBUSY; 1513 return -EBUSY;
1510 } 1514 }
1511 } 1515 }
@@ -1515,6 +1519,7 @@ static int s2255_open(struct inode *inode, struct file *file)
1515 if (NULL == fh) { 1519 if (NULL == fh) {
1516 dev->users[cur_channel]--; 1520 dev->users[cur_channel]--;
1517 mutex_unlock(&dev->open_lock); 1521 mutex_unlock(&dev->open_lock);
1522 unlock_kernel();
1518 return -ENOMEM; 1523 return -ENOMEM;
1519 } 1524 }
1520 1525
@@ -1548,6 +1553,7 @@ static int s2255_open(struct inode *inode, struct file *file)
1548 1553
1549 kref_get(&dev->kref); 1554 kref_get(&dev->kref);
1550 mutex_unlock(&dev->open_lock); 1555 mutex_unlock(&dev->open_lock);
1556 unlock_kernel();
1551 return 0; 1557 return 0;
1552} 1558}
1553 1559