diff options
Diffstat (limited to 'drivers/media/common/saa7146_video.c')
-rw-r--r-- | drivers/media/common/saa7146_video.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c index 7ebac7949df3..6b42713d97f4 100644 --- a/drivers/media/common/saa7146_video.c +++ b/drivers/media/common/saa7146_video.c | |||
@@ -378,20 +378,20 @@ static int s_fmt(struct saa7146_fh *fh, struct v4l2_format *f) | |||
378 | err = try_win(dev,&f->fmt.win); | 378 | err = try_win(dev,&f->fmt.win); |
379 | if (0 != err) | 379 | if (0 != err) |
380 | return err; | 380 | return err; |
381 | down(&dev->lock); | 381 | mutex_lock(&dev->lock); |
382 | fh->ov.win = f->fmt.win; | 382 | fh->ov.win = f->fmt.win; |
383 | fh->ov.nclips = f->fmt.win.clipcount; | 383 | fh->ov.nclips = f->fmt.win.clipcount; |
384 | if (fh->ov.nclips > 16) | 384 | if (fh->ov.nclips > 16) |
385 | fh->ov.nclips = 16; | 385 | fh->ov.nclips = 16; |
386 | if (copy_from_user(fh->ov.clips,f->fmt.win.clips,sizeof(struct v4l2_clip)*fh->ov.nclips)) { | 386 | if (copy_from_user(fh->ov.clips,f->fmt.win.clips,sizeof(struct v4l2_clip)*fh->ov.nclips)) { |
387 | up(&dev->lock); | 387 | mutex_unlock(&dev->lock); |
388 | return -EFAULT; | 388 | return -EFAULT; |
389 | } | 389 | } |
390 | 390 | ||
391 | /* fh->ov.fh is used to indicate that we have valid overlay informations, too */ | 391 | /* fh->ov.fh is used to indicate that we have valid overlay informations, too */ |
392 | fh->ov.fh = fh; | 392 | fh->ov.fh = fh; |
393 | 393 | ||
394 | up(&dev->lock); | 394 | mutex_unlock(&dev->lock); |
395 | 395 | ||
396 | /* check if our current overlay is active */ | 396 | /* check if our current overlay is active */ |
397 | if (IS_OVERLAY_ACTIVE(fh) != 0) { | 397 | if (IS_OVERLAY_ACTIVE(fh) != 0) { |
@@ -516,7 +516,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c) | |||
516 | return -EINVAL; | 516 | return -EINVAL; |
517 | } | 517 | } |
518 | 518 | ||
519 | down(&dev->lock); | 519 | mutex_lock(&dev->lock); |
520 | 520 | ||
521 | switch (ctrl->type) { | 521 | switch (ctrl->type) { |
522 | case V4L2_CTRL_TYPE_BOOLEAN: | 522 | case V4L2_CTRL_TYPE_BOOLEAN: |
@@ -560,7 +560,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c) | |||
560 | /* fixme: we can support changing VFLIP and HFLIP here... */ | 560 | /* fixme: we can support changing VFLIP and HFLIP here... */ |
561 | if (IS_CAPTURE_ACTIVE(fh) != 0) { | 561 | if (IS_CAPTURE_ACTIVE(fh) != 0) { |
562 | DEB_D(("V4L2_CID_HFLIP while active capture.\n")); | 562 | DEB_D(("V4L2_CID_HFLIP while active capture.\n")); |
563 | up(&dev->lock); | 563 | mutex_unlock(&dev->lock); |
564 | return -EINVAL; | 564 | return -EINVAL; |
565 | } | 565 | } |
566 | vv->hflip = c->value; | 566 | vv->hflip = c->value; |
@@ -568,7 +568,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c) | |||
568 | case V4L2_CID_VFLIP: | 568 | case V4L2_CID_VFLIP: |
569 | if (IS_CAPTURE_ACTIVE(fh) != 0) { | 569 | if (IS_CAPTURE_ACTIVE(fh) != 0) { |
570 | DEB_D(("V4L2_CID_VFLIP while active capture.\n")); | 570 | DEB_D(("V4L2_CID_VFLIP while active capture.\n")); |
571 | up(&dev->lock); | 571 | mutex_unlock(&dev->lock); |
572 | return -EINVAL; | 572 | return -EINVAL; |
573 | } | 573 | } |
574 | vv->vflip = c->value; | 574 | vv->vflip = c->value; |
@@ -577,7 +577,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c) | |||
577 | return -EINVAL; | 577 | return -EINVAL; |
578 | } | 578 | } |
579 | } | 579 | } |
580 | up(&dev->lock); | 580 | mutex_unlock(&dev->lock); |
581 | 581 | ||
582 | if (IS_OVERLAY_ACTIVE(fh) != 0) { | 582 | if (IS_OVERLAY_ACTIVE(fh) != 0) { |
583 | saa7146_stop_preview(fh); | 583 | saa7146_stop_preview(fh); |
@@ -939,7 +939,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int | |||
939 | } | 939 | } |
940 | } | 940 | } |
941 | 941 | ||
942 | down(&dev->lock); | 942 | mutex_lock(&dev->lock); |
943 | 943 | ||
944 | /* ok, accept it */ | 944 | /* ok, accept it */ |
945 | vv->ov_fb = *fb; | 945 | vv->ov_fb = *fb; |
@@ -948,7 +948,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int | |||
948 | vv->ov_fb.fmt.bytesperline = | 948 | vv->ov_fb.fmt.bytesperline = |
949 | vv->ov_fb.fmt.width*fmt->depth/8; | 949 | vv->ov_fb.fmt.width*fmt->depth/8; |
950 | 950 | ||
951 | up(&dev->lock); | 951 | mutex_unlock(&dev->lock); |
952 | 952 | ||
953 | return 0; | 953 | return 0; |
954 | } | 954 | } |
@@ -1086,7 +1086,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int | |||
1086 | } | 1086 | } |
1087 | } | 1087 | } |
1088 | 1088 | ||
1089 | down(&dev->lock); | 1089 | mutex_lock(&dev->lock); |
1090 | 1090 | ||
1091 | for(i = 0; i < dev->ext_vv_data->num_stds; i++) | 1091 | for(i = 0; i < dev->ext_vv_data->num_stds; i++) |
1092 | if (*id & dev->ext_vv_data->stds[i].id) | 1092 | if (*id & dev->ext_vv_data->stds[i].id) |
@@ -1098,7 +1098,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int | |||
1098 | found = 1; | 1098 | found = 1; |
1099 | } | 1099 | } |
1100 | 1100 | ||
1101 | up(&dev->lock); | 1101 | mutex_unlock(&dev->lock); |
1102 | 1102 | ||
1103 | if (vv->ov_suspend != NULL) { | 1103 | if (vv->ov_suspend != NULL) { |
1104 | saa7146_start_preview(vv->ov_suspend); | 1104 | saa7146_start_preview(vv->ov_suspend); |
@@ -1201,11 +1201,11 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int | |||
1201 | DEB_D(("VIDIOCGMBUF \n")); | 1201 | DEB_D(("VIDIOCGMBUF \n")); |
1202 | 1202 | ||
1203 | q = &fh->video_q; | 1203 | q = &fh->video_q; |
1204 | down(&q->lock); | 1204 | mutex_lock(&q->lock); |
1205 | err = videobuf_mmap_setup(q,gbuffers,gbufsize, | 1205 | err = videobuf_mmap_setup(q,gbuffers,gbufsize, |
1206 | V4L2_MEMORY_MMAP); | 1206 | V4L2_MEMORY_MMAP); |
1207 | if (err < 0) { | 1207 | if (err < 0) { |
1208 | up(&q->lock); | 1208 | mutex_unlock(&q->lock); |
1209 | return err; | 1209 | return err; |
1210 | } | 1210 | } |
1211 | memset(mbuf,0,sizeof(*mbuf)); | 1211 | memset(mbuf,0,sizeof(*mbuf)); |
@@ -1213,7 +1213,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int | |||
1213 | mbuf->size = gbuffers * gbufsize; | 1213 | mbuf->size = gbuffers * gbufsize; |
1214 | for (i = 0; i < gbuffers; i++) | 1214 | for (i = 0; i < gbuffers; i++) |
1215 | mbuf->offsets[i] = i * gbufsize; | 1215 | mbuf->offsets[i] = i * gbufsize; |
1216 | up(&q->lock); | 1216 | mutex_unlock(&q->lock); |
1217 | return 0; | 1217 | return 0; |
1218 | } | 1218 | } |
1219 | default: | 1219 | default: |
@@ -1414,7 +1414,7 @@ static int video_open(struct saa7146_dev *dev, struct file *file) | |||
1414 | sizeof(struct saa7146_buf), | 1414 | sizeof(struct saa7146_buf), |
1415 | file); | 1415 | file); |
1416 | 1416 | ||
1417 | init_MUTEX(&fh->video_q.lock); | 1417 | mutex_init(&fh->video_q.lock); |
1418 | 1418 | ||
1419 | return 0; | 1419 | return 0; |
1420 | } | 1420 | } |