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 <sam@xxxxxxxxxxxxxxxxxx> --- drivers/media/i2c/ov5640.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index eaefdb5..5031aab 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -2045,12 +2045,12 @@ 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: -- 2.7.4