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/saa5249.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/saa5249.c')
-rw-r--r-- | drivers/media/video/saa5249.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c index 0d639738d4e6..96c0fdf1a051 100644 --- a/drivers/media/video/saa5249.c +++ b/drivers/media/video/saa5249.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <linux/ioport.h> | 52 | #include <linux/ioport.h> |
53 | #include <linux/slab.h> | 53 | #include <linux/slab.h> |
54 | #include <linux/init.h> | 54 | #include <linux/init.h> |
55 | #include <linux/smp_lock.h> | ||
55 | #include <stdarg.h> | 56 | #include <stdarg.h> |
56 | #include <linux/i2c.h> | 57 | #include <linux/i2c.h> |
57 | #include <linux/videotext.h> | 58 | #include <linux/videotext.h> |
@@ -633,9 +634,12 @@ static int saa5249_open(struct inode *inode, struct file *file) | |||
633 | struct saa5249_device *t=vd->priv; | 634 | struct saa5249_device *t=vd->priv; |
634 | int err,pgbuf; | 635 | int err,pgbuf; |
635 | 636 | ||
637 | lock_kernel(); | ||
636 | err = video_exclusive_open(inode,file); | 638 | err = video_exclusive_open(inode,file); |
637 | if (err < 0) | 639 | if (err < 0) { |
640 | unlock_kernel(); | ||
638 | return err; | 641 | return err; |
642 | } | ||
639 | 643 | ||
640 | if (t->client==NULL) { | 644 | if (t->client==NULL) { |
641 | err = -ENODEV; | 645 | err = -ENODEV; |
@@ -664,10 +668,12 @@ static int saa5249_open(struct inode *inode, struct file *file) | |||
664 | t->is_searching[pgbuf] = false; | 668 | t->is_searching[pgbuf] = false; |
665 | } | 669 | } |
666 | t->virtual_mode = false; | 670 | t->virtual_mode = false; |
671 | unlock_kernel(); | ||
667 | return 0; | 672 | return 0; |
668 | 673 | ||
669 | fail: | 674 | fail: |
670 | video_exclusive_release(inode,file); | 675 | video_exclusive_release(inode,file); |
676 | unlock_kernel(); | ||
671 | return err; | 677 | return err; |
672 | } | 678 | } |
673 | 679 | ||