summaryrefslogtreecommitdiff
path: root/drivers/media/video/omap3isp/ispvideo.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-11-28 15:25:30 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-20 15:37:09 +0400
commitc3cd257402fdcd650816ec25b83480a24912430a (patch)
tree196dc0a3c236cdd7c61914926300d83ec00705d2 /drivers/media/video/omap3isp/ispvideo.c
parent22db44cb9cd67d56b02b2b5dceb10d3d1361b28b (diff)
downloadlinux-c3cd257402fdcd650816ec25b83480a24912430a.tar.xz
[media] omap3isp: video: Don't WARN() on unknown pixel formats
When mapping from a V4L2 pixel format to a media bus format in the VIDIOC_TRY_FMT and VIDIOC_S_FMT handlers, the requested format may be unsupported by the driver. Return a hardcoded format instead of WARN()ing in that case. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/omap3isp/ispvideo.c')
-rw-r--r--drivers/media/video/omap3isp/ispvideo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/video/omap3isp/ispvideo.c b/drivers/media/video/omap3isp/ispvideo.c
index d1000723c5ae..ffe7ce9eb4bc 100644
--- a/drivers/media/video/omap3isp/ispvideo.c
+++ b/drivers/media/video/omap3isp/ispvideo.c
@@ -210,14 +210,14 @@ static void isp_video_pix_to_mbus(const struct v4l2_pix_format *pix,
mbus->width = pix->width;
mbus->height = pix->height;
- for (i = 0; i < ARRAY_SIZE(formats); ++i) {
+ /* Skip the last format in the loop so that it will be selected if no
+ * match is found.
+ */
+ for (i = 0; i < ARRAY_SIZE(formats) - 1; ++i) {
if (formats[i].pixelformat == pix->pixelformat)
break;
}
- if (WARN_ON(i == ARRAY_SIZE(formats)))
- return;
-
mbus->code = formats[i].code;
mbus->colorspace = pix->colorspace;
mbus->field = pix->field;