Merge branch 'drm-next-merged' of git://people.freedesktop.org/~airlied/linux into...
[linux-2.6-block.git] / drivers / staging / media / omap4iss / iss_video.c
index 55938cccde7f0114c395e03e8d39ddc060a9de56..85c54fedddda27eb53c81d4023720bd8510e7dbf 100644 (file)
@@ -171,14 +171,14 @@ static void iss_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;