aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/cx231xx/cx231xx-video.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-video.c b/drivers/media/video/cx231xx/cx231xx-video.c
index a23ae73fe634..6a524d847110 100644
--- a/drivers/media/video/cx231xx/cx231xx-video.c
+++ b/drivers/media/video/cx231xx/cx231xx-video.c
@@ -955,8 +955,8 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
955{ 955{
956 struct cx231xx_fh *fh = priv; 956 struct cx231xx_fh *fh = priv;
957 struct cx231xx *dev = fh->dev; 957 struct cx231xx *dev = fh->dev;
958 int width = f->fmt.pix.width; 958 unsigned int width = f->fmt.pix.width;
959 int height = f->fmt.pix.height; 959 unsigned int height = f->fmt.pix.height;
960 unsigned int maxw = norm_maxw(dev); 960 unsigned int maxw = norm_maxw(dev);
961 unsigned int maxh = norm_maxh(dev); 961 unsigned int maxh = norm_maxh(dev);
962 unsigned int hscale, vscale; 962 unsigned int hscale, vscale;
@@ -971,17 +971,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
971 971
972 /* width must even because of the YUYV format 972 /* width must even because of the YUYV format
973 height must be even because of interlacing */ 973 height must be even because of interlacing */
974 height &= 0xfffe; 974 v4l_bound_align_image(&width, 48, maxw, 1, &height, 32, maxh, 1, 0);
975 width &= 0xfffe;
976
977 if (unlikely(height < 32))
978 height = 32;
979 if (unlikely(height > maxh))
980 height = maxh;
981 if (unlikely(width < 48))
982 width = 48;
983 if (unlikely(width > maxw))
984 width = maxw;
985 975
986 get_scale(dev, width, height, &hscale, &vscale); 976 get_scale(dev, width, height, &hscale, &vscale);
987 977