From f428948b98e3b9476057ee483e7e763a5ac61a69 Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Tue, 15 Nov 2011 15:55:17 -0300 Subject: [PATCH] [media] m5mols: Do not reset the configured pixel format when unexpected Initialize default pixel format in driver probe() rather than in s_power handler. This also prevents resetting the configuration applied before the device was powered on. Acked-by: HeungJun Kim Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/m5mols/m5mols_core.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/media/video/m5mols/m5mols_core.c b/drivers/media/video/m5mols/m5mols_core.c index ea594cf0fa56..12f223f3d0fd 100644 --- a/drivers/media/video/m5mols/m5mols_core.c +++ b/drivers/media/video/m5mols/m5mols_core.c @@ -864,13 +864,6 @@ static int m5mols_s_power(struct v4l2_subdev *sd, int on) ret = m5mols_sensor_power(info, true); if (!ret) ret = m5mols_fw_start(sd); - if (ret) - return ret; - - info->ffmt[M5MOLS_RESTYPE_MONITOR] = - m5mols_default_ffmt[M5MOLS_RESTYPE_MONITOR]; - info->ffmt[M5MOLS_RESTYPE_CAPTURE] = - m5mols_default_ffmt[M5MOLS_RESTYPE_CAPTURE]; return ret; } @@ -1007,6 +1000,8 @@ static int __devinit m5mols_probe(struct i2c_client *client, goto out_me; } info->res_type = M5MOLS_RESTYPE_MONITOR; + info->ffmt[0] = m5mols_default_ffmt[0]; + info->ffmt[1] = m5mols_default_ffmt[1]; ret = m5mols_sensor_power(info, true); if (ret) -- 2.39.5