[media] ov5642: avoid calling ov5642_find_datafmt() twice

Simplify ov5642_set_fmt().

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
Hans Verkuil 2015-05-04 07:25:52 -03:00 committed by Mauro Carvalho Chehab
parent 20efc1e9fc
commit b174eb750e

View File

@ -811,7 +811,7 @@ static int ov5642_set_fmt(struct v4l2_subdev *sd,
mf->field = V4L2_FIELD_NONE;
if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
priv->fmt = ov5642_find_datafmt(mf->code);
priv->fmt = fmt;
else
cfg->try_fmt = *mf;
return 0;