From: Sylwester Nawrocki Date: Tue, 15 Nov 2011 18:55:17 +0000 (-0300) Subject: [media] m5mols: Do not reset the configured pixel format when unexpected X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f428948b98e3b9476057ee483e7e763a5ac61a69;p=linux-beck.git [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 --- 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)