media: atomisp: move atomisp_g_fmt_cap()
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 4 Nov 2021 11:32:13 +0000 (11:32 +0000)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 15 Nov 2021 08:11:46 +0000 (08:11 +0000)
move atomisp_g_fmt_cap() for it to be after try_fmt, as we'll
re-use try_fmt there.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_ioctl.c

index 30483a84ed803fb38fcd60b18f5a15c4a03b8881..84ff97dabbed0677363349a409ee84d8d601073d 100644 (file)
@@ -833,6 +833,34 @@ static int atomisp_enum_fmt_cap(struct file *file, void *fh,
        return -EINVAL;
 }
 
+static int atomisp_g_fmt_file(struct file *file, void *fh,
+                             struct v4l2_format *f)
+{
+       struct video_device *vdev = video_devdata(file);
+       struct atomisp_device *isp = video_get_drvdata(vdev);
+       struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev);
+
+       rt_mutex_lock(&isp->mutex);
+       f->fmt.pix = pipe->pix;
+       rt_mutex_unlock(&isp->mutex);
+
+       return 0;
+}
+
+/* This function looks up the closest available resolution. */
+static int atomisp_try_fmt_cap(struct file *file, void *fh,
+                              struct v4l2_format *f)
+{
+       struct video_device *vdev = video_devdata(file);
+       struct atomisp_device *isp = video_get_drvdata(vdev);
+       int ret;
+
+       rt_mutex_lock(&isp->mutex);
+       ret = atomisp_try_fmt(vdev, &f->fmt.pix, NULL);
+       rt_mutex_unlock(&isp->mutex);
+       return ret;
+}
+
 static int atomisp_g_fmt_cap(struct file *file, void *fh,
                             struct v4l2_format *f)
 {
@@ -907,34 +935,6 @@ static int atomisp_g_fmt_cap(struct file *file, void *fh,
        return 0;
 }
 
-static int atomisp_g_fmt_file(struct file *file, void *fh,
-                             struct v4l2_format *f)
-{
-       struct video_device *vdev = video_devdata(file);
-       struct atomisp_device *isp = video_get_drvdata(vdev);
-       struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev);
-
-       rt_mutex_lock(&isp->mutex);
-       f->fmt.pix = pipe->pix;
-       rt_mutex_unlock(&isp->mutex);
-
-       return 0;
-}
-
-/* This function looks up the closest available resolution. */
-static int atomisp_try_fmt_cap(struct file *file, void *fh,
-                              struct v4l2_format *f)
-{
-       struct video_device *vdev = video_devdata(file);
-       struct atomisp_device *isp = video_get_drvdata(vdev);
-       int ret;
-
-       rt_mutex_lock(&isp->mutex);
-       ret = atomisp_try_fmt(vdev, &f->fmt.pix, NULL);
-       rt_mutex_unlock(&isp->mutex);
-       return ret;
-}
-
 static int atomisp_s_fmt_cap(struct file *file, void *fh,
                             struct v4l2_format *f)
 {