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/video-buf.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/video-buf.c')
-rw-r--r-- | drivers/media/video/video-buf.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/media/video/video-buf.c b/drivers/media/video/video-buf.c index 9ef477523d27..cb1c228e29f8 100644 --- a/drivers/media/video/video-buf.c +++ b/drivers/media/video/video-buf.c | |||
@@ -385,7 +385,7 @@ void videobuf_queue_init(struct videobuf_queue* q, | |||
385 | q->ops = ops; | 385 | q->ops = ops; |
386 | q->priv_data = priv; | 386 | q->priv_data = priv; |
387 | 387 | ||
388 | init_MUTEX(&q->lock); | 388 | mutex_init(&q->lock); |
389 | INIT_LIST_HEAD(&q->stream); | 389 | INIT_LIST_HEAD(&q->stream); |
390 | } | 390 | } |
391 | 391 | ||
@@ -549,7 +549,7 @@ videobuf_reqbufs(struct videobuf_queue *q, | |||
549 | if (!list_empty(&q->stream)) | 549 | if (!list_empty(&q->stream)) |
550 | return -EBUSY; | 550 | return -EBUSY; |
551 | 551 | ||
552 | down(&q->lock); | 552 | mutex_lock(&q->lock); |
553 | count = req->count; | 553 | count = req->count; |
554 | if (count > VIDEO_MAX_FRAME) | 554 | if (count > VIDEO_MAX_FRAME) |
555 | count = VIDEO_MAX_FRAME; | 555 | count = VIDEO_MAX_FRAME; |
@@ -566,7 +566,7 @@ videobuf_reqbufs(struct videobuf_queue *q, | |||
566 | req->count = count; | 566 | req->count = count; |
567 | 567 | ||
568 | done: | 568 | done: |
569 | up(&q->lock); | 569 | mutex_unlock(&q->lock); |
570 | return retval; | 570 | return retval; |
571 | } | 571 | } |
572 | 572 | ||
@@ -592,7 +592,7 @@ videobuf_qbuf(struct videobuf_queue *q, | |||
592 | unsigned long flags; | 592 | unsigned long flags; |
593 | int retval; | 593 | int retval; |
594 | 594 | ||
595 | down(&q->lock); | 595 | mutex_lock(&q->lock); |
596 | retval = -EBUSY; | 596 | retval = -EBUSY; |
597 | if (q->reading) | 597 | if (q->reading) |
598 | goto done; | 598 | goto done; |
@@ -652,7 +652,7 @@ videobuf_qbuf(struct videobuf_queue *q, | |||
652 | retval = 0; | 652 | retval = 0; |
653 | 653 | ||
654 | done: | 654 | done: |
655 | up(&q->lock); | 655 | mutex_unlock(&q->lock); |
656 | return retval; | 656 | return retval; |
657 | } | 657 | } |
658 | 658 | ||
@@ -663,7 +663,7 @@ videobuf_dqbuf(struct videobuf_queue *q, | |||
663 | struct videobuf_buffer *buf; | 663 | struct videobuf_buffer *buf; |
664 | int retval; | 664 | int retval; |
665 | 665 | ||
666 | down(&q->lock); | 666 | mutex_lock(&q->lock); |
667 | retval = -EBUSY; | 667 | retval = -EBUSY; |
668 | if (q->reading) | 668 | if (q->reading) |
669 | goto done; | 669 | goto done; |
@@ -693,7 +693,7 @@ videobuf_dqbuf(struct videobuf_queue *q, | |||
693 | videobuf_status(b,buf,q->type); | 693 | videobuf_status(b,buf,q->type); |
694 | 694 | ||
695 | done: | 695 | done: |
696 | up(&q->lock); | 696 | mutex_unlock(&q->lock); |
697 | return retval; | 697 | return retval; |
698 | } | 698 | } |
699 | 699 | ||
@@ -704,7 +704,7 @@ int videobuf_streamon(struct videobuf_queue *q) | |||
704 | unsigned long flags; | 704 | unsigned long flags; |
705 | int retval; | 705 | int retval; |
706 | 706 | ||
707 | down(&q->lock); | 707 | mutex_lock(&q->lock); |
708 | retval = -EBUSY; | 708 | retval = -EBUSY; |
709 | if (q->reading) | 709 | if (q->reading) |
710 | goto done; | 710 | goto done; |
@@ -721,7 +721,7 @@ int videobuf_streamon(struct videobuf_queue *q) | |||
721 | spin_unlock_irqrestore(q->irqlock,flags); | 721 | spin_unlock_irqrestore(q->irqlock,flags); |
722 | 722 | ||
723 | done: | 723 | done: |
724 | up(&q->lock); | 724 | mutex_unlock(&q->lock); |
725 | return retval; | 725 | return retval; |
726 | } | 726 | } |
727 | 727 | ||
@@ -729,7 +729,7 @@ int videobuf_streamoff(struct videobuf_queue *q) | |||
729 | { | 729 | { |
730 | int retval = -EINVAL; | 730 | int retval = -EINVAL; |
731 | 731 | ||
732 | down(&q->lock); | 732 | mutex_lock(&q->lock); |
733 | if (!q->streaming) | 733 | if (!q->streaming) |
734 | goto done; | 734 | goto done; |
735 | videobuf_queue_cancel(q); | 735 | videobuf_queue_cancel(q); |
@@ -737,7 +737,7 @@ int videobuf_streamoff(struct videobuf_queue *q) | |||
737 | retval = 0; | 737 | retval = 0; |
738 | 738 | ||
739 | done: | 739 | done: |
740 | up(&q->lock); | 740 | mutex_unlock(&q->lock); |
741 | return retval; | 741 | return retval; |
742 | } | 742 | } |
743 | 743 | ||
@@ -792,7 +792,7 @@ ssize_t videobuf_read_one(struct videobuf_queue *q, | |||
792 | unsigned size, nbufs, bytes; | 792 | unsigned size, nbufs, bytes; |
793 | int retval; | 793 | int retval; |
794 | 794 | ||
795 | down(&q->lock); | 795 | mutex_lock(&q->lock); |
796 | 796 | ||
797 | nbufs = 1; size = 0; | 797 | nbufs = 1; size = 0; |
798 | q->ops->buf_setup(q,&nbufs,&size); | 798 | q->ops->buf_setup(q,&nbufs,&size); |
@@ -860,7 +860,7 @@ ssize_t videobuf_read_one(struct videobuf_queue *q, | |||
860 | } | 860 | } |
861 | 861 | ||
862 | done: | 862 | done: |
863 | up(&q->lock); | 863 | mutex_unlock(&q->lock); |
864 | return retval; | 864 | return retval; |
865 | } | 865 | } |
866 | 866 | ||
@@ -922,7 +922,7 @@ ssize_t videobuf_read_stream(struct videobuf_queue *q, | |||
922 | unsigned long flags; | 922 | unsigned long flags; |
923 | 923 | ||
924 | dprintk(2,"%s\n",__FUNCTION__); | 924 | dprintk(2,"%s\n",__FUNCTION__); |
925 | down(&q->lock); | 925 | mutex_lock(&q->lock); |
926 | retval = -EBUSY; | 926 | retval = -EBUSY; |
927 | if (q->streaming) | 927 | if (q->streaming) |
928 | goto done; | 928 | goto done; |
@@ -996,7 +996,7 @@ ssize_t videobuf_read_stream(struct videobuf_queue *q, | |||
996 | } | 996 | } |
997 | 997 | ||
998 | done: | 998 | done: |
999 | up(&q->lock); | 999 | mutex_unlock(&q->lock); |
1000 | return retval; | 1000 | return retval; |
1001 | } | 1001 | } |
1002 | 1002 | ||
@@ -1007,7 +1007,7 @@ unsigned int videobuf_poll_stream(struct file *file, | |||
1007 | struct videobuf_buffer *buf = NULL; | 1007 | struct videobuf_buffer *buf = NULL; |
1008 | unsigned int rc = 0; | 1008 | unsigned int rc = 0; |
1009 | 1009 | ||
1010 | down(&q->lock); | 1010 | mutex_lock(&q->lock); |
1011 | if (q->streaming) { | 1011 | if (q->streaming) { |
1012 | if (!list_empty(&q->stream)) | 1012 | if (!list_empty(&q->stream)) |
1013 | buf = list_entry(q->stream.next, | 1013 | buf = list_entry(q->stream.next, |
@@ -1035,7 +1035,7 @@ unsigned int videobuf_poll_stream(struct file *file, | |||
1035 | buf->state == STATE_ERROR) | 1035 | buf->state == STATE_ERROR) |
1036 | rc = POLLIN|POLLRDNORM; | 1036 | rc = POLLIN|POLLRDNORM; |
1037 | } | 1037 | } |
1038 | up(&q->lock); | 1038 | mutex_unlock(&q->lock); |
1039 | return rc; | 1039 | return rc; |
1040 | } | 1040 | } |
1041 | 1041 | ||
@@ -1064,7 +1064,7 @@ videobuf_vm_close(struct vm_area_struct *vma) | |||
1064 | map->count--; | 1064 | map->count--; |
1065 | if (0 == map->count) { | 1065 | if (0 == map->count) { |
1066 | dprintk(1,"munmap %p q=%p\n",map,q); | 1066 | dprintk(1,"munmap %p q=%p\n",map,q); |
1067 | down(&q->lock); | 1067 | mutex_lock(&q->lock); |
1068 | for (i = 0; i < VIDEO_MAX_FRAME; i++) { | 1068 | for (i = 0; i < VIDEO_MAX_FRAME; i++) { |
1069 | if (NULL == q->bufs[i]) | 1069 | if (NULL == q->bufs[i]) |
1070 | continue; | 1070 | continue; |
@@ -1076,7 +1076,7 @@ videobuf_vm_close(struct vm_area_struct *vma) | |||
1076 | q->bufs[i]->baddr = 0; | 1076 | q->bufs[i]->baddr = 0; |
1077 | q->ops->buf_release(q,q->bufs[i]); | 1077 | q->ops->buf_release(q,q->bufs[i]); |
1078 | } | 1078 | } |
1079 | up(&q->lock); | 1079 | mutex_unlock(&q->lock); |
1080 | kfree(map); | 1080 | kfree(map); |
1081 | } | 1081 | } |
1082 | return; | 1082 | return; |
@@ -1170,7 +1170,7 @@ int videobuf_mmap_mapper(struct videobuf_queue *q, | |||
1170 | unsigned int first,last,size,i; | 1170 | unsigned int first,last,size,i; |
1171 | int retval; | 1171 | int retval; |
1172 | 1172 | ||
1173 | down(&q->lock); | 1173 | mutex_lock(&q->lock); |
1174 | retval = -EINVAL; | 1174 | retval = -EINVAL; |
1175 | if (!(vma->vm_flags & VM_WRITE)) { | 1175 | if (!(vma->vm_flags & VM_WRITE)) { |
1176 | dprintk(1,"mmap app bug: PROT_WRITE please\n"); | 1176 | dprintk(1,"mmap app bug: PROT_WRITE please\n"); |
@@ -1238,7 +1238,7 @@ int videobuf_mmap_mapper(struct videobuf_queue *q, | |||
1238 | retval = 0; | 1238 | retval = 0; |
1239 | 1239 | ||
1240 | done: | 1240 | done: |
1241 | up(&q->lock); | 1241 | mutex_unlock(&q->lock); |
1242 | return retval; | 1242 | return retval; |
1243 | } | 1243 | } |
1244 | 1244 | ||