aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 0a2ff4afe416..0aaf4e767e0d 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -630,16 +630,10 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
630 if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size) 630 if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size)
631 return -EINVAL; 631 return -EINVAL;
632 632
633 if (buf->fmt != fh->fmt || 633 buf->fmt = fh->fmt;
634 buf->vb.width != dev->width || 634 buf->vb.width = dev->width;
635 buf->vb.height != dev->height || 635 buf->vb.height = dev->height;
636 buf->vb.field != field) { 636 buf->vb.field = field;
637 buf->fmt = fh->fmt;
638 buf->vb.width = dev->width;
639 buf->vb.height = dev->height;
640 buf->vb.field = field;
641 buf->vb.state = VIDEOBUF_NEEDS_INIT;
642 }
643 637
644 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) { 638 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
645 rc = videobuf_iolock(vq, &buf->vb, NULL); 639 rc = videobuf_iolock(vq, &buf->vb, NULL);
@@ -974,6 +968,12 @@ static int vidioc_s_fmt_cap(struct file *file, void *priv,
974 968
975 mutex_lock(&dev->lock); 969 mutex_lock(&dev->lock);
976 970
971 if (videobuf_queue_is_busy(&fh->vb_vidq)) {
972 em28xx_errdev("%s queue busy\n", __func__);
973 rc = -EBUSY;
974 goto out;
975 }
976
977 /* set new image size */ 977 /* set new image size */
978 dev->width = f->fmt.pix.width; 978 dev->width = f->fmt.pix.width;
979 dev->height = f->fmt.pix.height; 979 dev->height = f->fmt.pix.height;
@@ -985,8 +985,11 @@ static int vidioc_s_fmt_cap(struct file *file, void *priv,
985 em28xx_set_alternate(dev); 985 em28xx_set_alternate(dev);
986 em28xx_resolution_set(dev); 986 em28xx_resolution_set(dev);
987 987
988 rc = 0;
989
990out:
988 mutex_unlock(&dev->lock); 991 mutex_unlock(&dev->lock);
989 return 0; 992 return rc;
990} 993}
991 994
992static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm) 995static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)