summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/mt9t031.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-06-01 05:21:32 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-01 05:21:32 -0300
commitded3cfe6e3debc87d199572ce1c62204c5a37391 (patch)
treeb7c9d6add022ea7728933fb32bc8540813c2e210 /linux/drivers/media/video/mt9t031.c
parentdd4931dd692b5001b3ccb4d7d74c1d4481f3a7be (diff)
parent0b81474a751308c61db74ee4088c8b557b913c3c (diff)
downloadmediapointer-dvb-s2-ded3cfe6e3debc87d199572ce1c62204c5a37391.tar.gz
mediapointer-dvb-s2-ded3cfe6e3debc87d199572ce1c62204c5a37391.tar.bz2
merge: http://linuxtv.org/hg/~tap/v4l-dvb
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;
}