diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-30 07:43:36 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:36:47 -0400 |
commit | d56dc61265d2527a63ab5b0f03199a43cd89ca36 (patch) | |
tree | bea2a5b12fc120ca6e8797b2f16ad9696e0f25dd /drivers/media/video/zr364xx.c | |
parent | 95f73c5b57990c97047c200b8746ab62a360c5bc (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/zr364xx.c')
-rw-r--r-- | drivers/media/video/zr364xx.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c index 18d1c4ba79fb..4e1ef10d22df 100644 --- a/drivers/media/video/zr364xx.c +++ b/drivers/media/video/zr364xx.c | |||
@@ -643,14 +643,18 @@ static int zr364xx_open(struct inode *inode, struct file *file) | |||
643 | 643 | ||
644 | cam->skip = 2; | 644 | cam->skip = 2; |
645 | 645 | ||
646 | lock_kernel(); | ||
646 | err = video_exclusive_open(inode, file); | 647 | err = video_exclusive_open(inode, file); |
647 | if (err < 0) | 648 | if (err < 0) { |
649 | unlock_kernel(); | ||
648 | return err; | 650 | return err; |
651 | } | ||
649 | 652 | ||
650 | if (!cam->framebuf) { | 653 | if (!cam->framebuf) { |
651 | cam->framebuf = vmalloc_32(MAX_FRAME_SIZE * FRAMES); | 654 | cam->framebuf = vmalloc_32(MAX_FRAME_SIZE * FRAMES); |
652 | if (!cam->framebuf) { | 655 | if (!cam->framebuf) { |
653 | info("vmalloc_32 failed!"); | 656 | info("vmalloc_32 failed!"); |
657 | unlock_kernel(); | ||
654 | return -ENOMEM; | 658 | return -ENOMEM; |
655 | } | 659 | } |
656 | } | 660 | } |
@@ -664,6 +668,7 @@ static int zr364xx_open(struct inode *inode, struct file *file) | |||
664 | if (err < 0) { | 668 | if (err < 0) { |
665 | info("error during open sequence: %d", i); | 669 | info("error during open sequence: %d", i); |
666 | mutex_unlock(&cam->lock); | 670 | mutex_unlock(&cam->lock); |
671 | unlock_kernel(); | ||
667 | return err; | 672 | return err; |
668 | } | 673 | } |
669 | } | 674 | } |
@@ -676,6 +681,7 @@ static int zr364xx_open(struct inode *inode, struct file *file) | |||
676 | mdelay(100); | 681 | mdelay(100); |
677 | 682 | ||
678 | mutex_unlock(&cam->lock); | 683 | mutex_unlock(&cam->lock); |
684 | unlock_kernel(); | ||
679 | return 0; | 685 | return 0; |
680 | } | 686 | } |
681 | 687 | ||