Commit 9ac560d4 authored by Niklas Söderlund's avatar Niklas Söderlund Committed by Mauro Carvalho Chehab

media: rcar-vin: Handle special pixel formats in a switch

Before extending the special pixel format handling turn the multiple if
statements into a switch.
Suggested-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 1498dfba
......@@ -73,11 +73,18 @@ const struct rvin_video_format *rvin_format_from_pixel(struct rvin_dev *vin,
{
int i;
if (vin->info->model == RCAR_M1 && pixelformat == V4L2_PIX_FMT_XBGR32)
switch (pixelformat) {
case V4L2_PIX_FMT_XBGR32:
if (vin->info->model == RCAR_M1)
return NULL;
if (pixelformat == V4L2_PIX_FMT_NV12 && !vin->info->nv12)
break;
case V4L2_PIX_FMT_NV12:
if (!vin->info->nv12)
return NULL;
break;
default:
break;
}
for (i = 0; i < ARRAY_SIZE(rvin_formats); i++)
if (rvin_formats[i].fourcc == pixelformat)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment