diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-02-07 03:49:14 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-02-07 03:49:14 -0500 |
commit | 3593cab5d62c4c7abced1076710f9bc2d8847433 (patch) | |
tree | dd5dc21961f6b4aef6900b0c2eb63ce7c70aecd5 /drivers/media/video/c-qcam.c | |
parent | 538f9630afbbe429ecbcdcf92536200293a8e4b3 (diff) |
V4L/DVB (3318b): sem2mutex: drivers/media/, #2
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/c-qcam.c')
-rw-r--r-- | drivers/media/video/c-qcam.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c index 9976db4f6da8..8211fd8d7cbf 100644 --- a/drivers/media/video/c-qcam.c +++ b/drivers/media/video/c-qcam.c | |||
@@ -34,7 +34,8 @@ | |||
34 | #include <linux/parport.h> | 34 | #include <linux/parport.h> |
35 | #include <linux/sched.h> | 35 | #include <linux/sched.h> |
36 | #include <linux/videodev.h> | 36 | #include <linux/videodev.h> |
37 | #include <asm/semaphore.h> | 37 | #include <linux/mutex.h> |
38 | |||
38 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
39 | 40 | ||
40 | struct qcam_device { | 41 | struct qcam_device { |
@@ -47,7 +48,7 @@ struct qcam_device { | |||
47 | int contrast, brightness, whitebal; | 48 | int contrast, brightness, whitebal; |
48 | int top, left; | 49 | int top, left; |
49 | unsigned int bidirectional; | 50 | unsigned int bidirectional; |
50 | struct semaphore lock; | 51 | struct mutex lock; |
51 | }; | 52 | }; |
52 | 53 | ||
53 | /* cameras maximum */ | 54 | /* cameras maximum */ |
@@ -581,11 +582,11 @@ static int qcam_do_ioctl(struct inode *inode, struct file *file, | |||
581 | qcam->contrast = p->contrast>>8; | 582 | qcam->contrast = p->contrast>>8; |
582 | qcam->whitebal = p->whiteness>>8; | 583 | qcam->whitebal = p->whiteness>>8; |
583 | 584 | ||
584 | down(&qcam->lock); | 585 | mutex_lock(&qcam->lock); |
585 | parport_claim_or_block(qcam->pdev); | 586 | parport_claim_or_block(qcam->pdev); |
586 | qc_setup(qcam); | 587 | qc_setup(qcam); |
587 | parport_release(qcam->pdev); | 588 | parport_release(qcam->pdev); |
588 | up(&qcam->lock); | 589 | mutex_unlock(&qcam->lock); |
589 | return 0; | 590 | return 0; |
590 | } | 591 | } |
591 | case VIDIOCSWIN: | 592 | case VIDIOCSWIN: |
@@ -628,11 +629,11 @@ static int qcam_do_ioctl(struct inode *inode, struct file *file, | |||
628 | #endif | 629 | #endif |
629 | /* Ok we figured out what to use from our | 630 | /* Ok we figured out what to use from our |
630 | wide choice */ | 631 | wide choice */ |
631 | down(&qcam->lock); | 632 | mutex_lock(&qcam->lock); |
632 | parport_claim_or_block(qcam->pdev); | 633 | parport_claim_or_block(qcam->pdev); |
633 | qc_setup(qcam); | 634 | qc_setup(qcam); |
634 | parport_release(qcam->pdev); | 635 | parport_release(qcam->pdev); |
635 | up(&qcam->lock); | 636 | mutex_unlock(&qcam->lock); |
636 | return 0; | 637 | return 0; |
637 | } | 638 | } |
638 | case VIDIOCGWIN: | 639 | case VIDIOCGWIN: |
@@ -672,12 +673,12 @@ static ssize_t qcam_read(struct file *file, char __user *buf, | |||
672 | struct qcam_device *qcam=(struct qcam_device *)v; | 673 | struct qcam_device *qcam=(struct qcam_device *)v; |
673 | int len; | 674 | int len; |
674 | 675 | ||
675 | down(&qcam->lock); | 676 | mutex_lock(&qcam->lock); |
676 | parport_claim_or_block(qcam->pdev); | 677 | parport_claim_or_block(qcam->pdev); |
677 | /* Probably should have a semaphore against multiple users */ | 678 | /* Probably should have a semaphore against multiple users */ |
678 | len = qc_capture(qcam, buf,count); | 679 | len = qc_capture(qcam, buf,count); |
679 | parport_release(qcam->pdev); | 680 | parport_release(qcam->pdev); |
680 | up(&qcam->lock); | 681 | mutex_unlock(&qcam->lock); |
681 | return len; | 682 | return len; |
682 | } | 683 | } |
683 | 684 | ||
@@ -727,7 +728,7 @@ static struct qcam_device *qcam_init(struct parport *port) | |||
727 | 728 | ||
728 | memcpy(&q->vdev, &qcam_template, sizeof(qcam_template)); | 729 | memcpy(&q->vdev, &qcam_template, sizeof(qcam_template)); |
729 | 730 | ||
730 | init_MUTEX(&q->lock); | 731 | mutex_init(&q->lock); |
731 | q->width = q->ccd_width = 320; | 732 | q->width = q->ccd_width = 320; |
732 | q->height = q->ccd_height = 240; | 733 | q->height = q->ccd_height = 240; |
733 | q->mode = QC_MILLIONS | QC_DECIMATION_1; | 734 | q->mode = QC_MILLIONS | QC_DECIMATION_1; |