]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] s5k6a3: Fix VIDIOC_SUBDEV_G_FMT ioctl for TRY format
authorJacek Anaszewski <j.anaszewski@samsung.com>
Mon, 18 Jan 2016 16:10:25 +0000 (14:10 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 25 Jan 2016 12:28:25 +0000 (10:28 -0200)
VIDIOC_SUBDEV_G_FMT ioctl should return TRY format previously
set with VIDIOC_SUBDEV_S_FMT. Currently it is not the case as
only ACTIVE formats are saved in the driver. Since the driver
doesn't alter hardware state in the set_fmt op anyway, the
op can save the format in both TRY and ACTIVE case.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/i2c/s5k6a3.c

index b9e43ffa50859caeb4ce2b8343f660a598d249ff..cbe4711e9b31acfca212a8ef0a96867c03bb45fb 100644 (file)
@@ -144,8 +144,7 @@ static int s5k6a3_set_fmt(struct v4l2_subdev *sd,
        mf = __s5k6a3_get_format(sensor, cfg, fmt->pad, fmt->which);
        if (mf) {
                mutex_lock(&sensor->lock);
-               if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE)
-                       *mf = fmt->format;
+               *mf = fmt->format;
                mutex_unlock(&sensor->lock);
        }
        return 0;