summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/mt9t031.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-06-06 08:15:26 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-06 08:15:26 -0300
commita54e4ff7ad973562ecb961a02ea8da66e2334aef (patch)
treefe475f0216d4971e771364a4fce63e759fd858ac /linux/drivers/media/video/mt9t031.c
parentab62c90c3f2b6debe4c45c66aa08b5a65039e40e (diff)
parentd336dddd42e43b5465cd58b5a4812011805905df (diff)
downloadmediapointer-dvb-s2-a54e4ff7ad973562ecb961a02ea8da66e2334aef.tar.gz
mediapointer-dvb-s2-a54e4ff7ad973562ecb961a02ea8da66e2334aef.tar.bz2
merge: http://kernellabs.com/hg/~dheitmueller/misc-fixes-2
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/mt9t031.c')
-rw-r--r--linux/drivers/media/video/mt9t031.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/linux/drivers/media/video/mt9t031.c b/linux/drivers/media/video/mt9t031.c
index 381dd0fbe..a57051522 100644
--- a/linux/drivers/media/video/mt9t031.c
+++ b/linux/drivers/media/video/mt9t031.c
@@ -385,17 +385,9 @@ static int mt9t031_try_fmt(struct soc_camera_device *icd,
{
struct v4l2_pix_format *pix = &f->fmt.pix;
- if (pix->height < MT9T031_MIN_HEIGHT)
- pix->height = MT9T031_MIN_HEIGHT;
- if (pix->height > MT9T031_MAX_HEIGHT)
- pix->height = MT9T031_MAX_HEIGHT;
- if (pix->width < MT9T031_MIN_WIDTH)
- pix->width = MT9T031_MIN_WIDTH;
- if (pix->width > MT9T031_MAX_WIDTH)
- pix->width = MT9T031_MAX_WIDTH;
-
- pix->width &= ~0x01; /* has to be even */
- pix->height &= ~0x01; /* has to be even */
+ v4l_bound_align_image(
+ &pix->width, MT9T031_MIN_WIDTH, MT9T031_MAX_WIDTH, 1,
+ &pix->height, MT9T031_MIN_HEIGHT, MT9T031_MAX_HEIGHT, 1, 0);
return 0;
}