From: Sam Bobrowicz Date: Thu, 11 Oct 2018 16:23:26 +0000 (-0700) Subject: media: ov5640: fix resolution update X-Git-Tag: xlnx_rebase_v4.14_2018.3~61 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/zynq/linux.git/commitdiff_plain/ededc7acc6d55e276b09bcd013e422b1cf7ae260 media: ov5640: fix resolution update set_fmt was not properly triggering a mode change when a new mode was set that happened to have the same format as the previous mode (for example, when only changing the frame dimensions). Fix this. Signed-off-by: Sam Bobrowicz Signed-off-by: Michal Simek --- diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index 0e40d649b281..43ea3ba27365 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -2266,12 +2266,11 @@ static int ov5640_set_fmt(struct v4l2_subdev *sd, goto out; } - if (new_mode != sensor->current_mode) { + if (new_mode != sensor->current_mode || + mbus_fmt->code != sensor->fmt.code) { + sensor->fmt = *mbus_fmt; sensor->current_mode = new_mode; sensor->pending_mode_change = true; - } - if (mbus_fmt->code != sensor->fmt.code) { - sensor->fmt = *mbus_fmt; sensor->pending_fmt_change = true; } out: