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/usbvideo | |
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/usbvideo')
-rw-r--r-- | drivers/media/video/usbvideo/vicam.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c index 2eb45829791c..efb878a7402e 100644 --- a/drivers/media/video/usbvideo/vicam.c +++ b/drivers/media/video/usbvideo/vicam.c | |||
@@ -488,20 +488,24 @@ vicam_open(struct inode *inode, struct file *file) | |||
488 | * rely on this fact forever. | 488 | * rely on this fact forever. |
489 | */ | 489 | */ |
490 | 490 | ||
491 | lock_kernel(); | ||
491 | if (cam->open_count > 0) { | 492 | if (cam->open_count > 0) { |
492 | printk(KERN_INFO | 493 | printk(KERN_INFO |
493 | "vicam_open called on already opened camera"); | 494 | "vicam_open called on already opened camera"); |
495 | unlock_kernel(); | ||
494 | return -EBUSY; | 496 | return -EBUSY; |
495 | } | 497 | } |
496 | 498 | ||
497 | cam->raw_image = kmalloc(VICAM_MAX_READ_SIZE, GFP_KERNEL); | 499 | cam->raw_image = kmalloc(VICAM_MAX_READ_SIZE, GFP_KERNEL); |
498 | if (!cam->raw_image) { | 500 | if (!cam->raw_image) { |
501 | unlock_kernel(); | ||
499 | return -ENOMEM; | 502 | return -ENOMEM; |
500 | } | 503 | } |
501 | 504 | ||
502 | cam->framebuf = rvmalloc(VICAM_MAX_FRAME_SIZE * VICAM_FRAMES); | 505 | cam->framebuf = rvmalloc(VICAM_MAX_FRAME_SIZE * VICAM_FRAMES); |
503 | if (!cam->framebuf) { | 506 | if (!cam->framebuf) { |
504 | kfree(cam->raw_image); | 507 | kfree(cam->raw_image); |
508 | unlock_kernel(); | ||
505 | return -ENOMEM; | 509 | return -ENOMEM; |
506 | } | 510 | } |
507 | 511 | ||
@@ -509,6 +513,7 @@ vicam_open(struct inode *inode, struct file *file) | |||
509 | if (!cam->cntrlbuf) { | 513 | if (!cam->cntrlbuf) { |
510 | kfree(cam->raw_image); | 514 | kfree(cam->raw_image); |
511 | rvfree(cam->framebuf, VICAM_MAX_FRAME_SIZE * VICAM_FRAMES); | 515 | rvfree(cam->framebuf, VICAM_MAX_FRAME_SIZE * VICAM_FRAMES); |
516 | unlock_kernel(); | ||
512 | return -ENOMEM; | 517 | return -ENOMEM; |
513 | } | 518 | } |
514 | 519 | ||
@@ -526,6 +531,7 @@ vicam_open(struct inode *inode, struct file *file) | |||
526 | cam->open_count++; | 531 | cam->open_count++; |
527 | 532 | ||
528 | file->private_data = cam; | 533 | file->private_data = cam; |
534 | unlock_kernel(); | ||
529 | 535 | ||
530 | return 0; | 536 | return 0; |
531 | } | 537 | } |