diff options
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 2d88afefecf5..1681af192b02 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -730,19 +730,17 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, | |||
730 | /* width must even because of the YUYV format | 730 | /* width must even because of the YUYV format |
731 | height must be even because of interlacing */ | 731 | height must be even because of interlacing */ |
732 | height &= 0xfffe; | 732 | height &= 0xfffe; |
733 | width &= 0xfffe; | 733 | width &= 0xfffe; |
734 | 734 | ||
735 | if (height < 32) | 735 | if (unlikely(height < 32)) |
736 | height = 32; | 736 | height = 32; |
737 | if (height > maxh) | 737 | if (unlikely(height > maxh)) |
738 | height = maxh; | 738 | height = maxh; |
739 | if (width < 48) | 739 | if (unlikely(width < 48)) |
740 | width = 48; | 740 | width = 48; |
741 | if (width > maxw) | 741 | if (unlikely(width > maxw)) |
742 | width = maxw; | 742 | width = maxw; |
743 | 743 | ||
744 | mutex_lock(&dev->lock); | ||
745 | |||
746 | if (dev->board.is_em2800) { | 744 | if (dev->board.is_em2800) { |
747 | /* the em2800 can only scale down to 50% */ | 745 | /* the em2800 can only scale down to 50% */ |
748 | if (height % (maxh / 2)) | 746 | if (height % (maxh / 2)) |
@@ -772,7 +770,6 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, | |||
772 | f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; | 770 | f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; |
773 | f->fmt.pix.field = V4L2_FIELD_INTERLACED; | 771 | f->fmt.pix.field = V4L2_FIELD_INTERLACED; |
774 | 772 | ||
775 | mutex_unlock(&dev->lock); | ||
776 | return 0; | 773 | return 0; |
777 | } | 774 | } |
778 | 775 | ||