From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: unlisted-recipients:; (no To-header on input)
Cc: linuxarm@huawei.com, mauro.chehab@huawei.com,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
Dan Carpenter <dan.carpenter@oracle.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ingo Molnar <mingo@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Tsuchiya Yuto <kitakar@gmail.com>,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
linux-staging@lists.linux.dev
Subject: [PATCH 5/7] media: atomisp: move atomisp_g_fmt_cap()
Date: Thu, 4 Nov 2021 12:05:54 +0000 [thread overview]
Message-ID: <75e35d0ea4b6ee7f47bbed61f2eb258a07bcd01f.1636026959.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1636026959.git.mchehab+huawei@kernel.org>
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>
---
To mailbombing on a large number of people, only mailing lists were C/C on the cover.
See [PATCH 0/7] at: https://lore.kernel.org/all/cover.1636026959.git.mchehab+huawei@kernel.org/
.../staging/media/atomisp/pci/atomisp_ioctl.c | 56 +++++++++----------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index 30483a84ed80..84ff97dabbed 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -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)
{
--
2.31.1
next prev parent reply other threads:[~2021-11-04 12:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-04 12:05 [PATCH 0/7] Address issues preventing camorama to work with atomisp Mauro Carvalho Chehab
2021-11-04 12:05 ` [PATCH 1/7] media: atomisp-ov2680: use v4l2_find_nearest_size() Mauro Carvalho Chehab
2021-11-04 12:05 ` [PATCH 2/7] media: atomisp: move a debug printf to a better place Mauro Carvalho Chehab
2021-11-04 12:05 ` [PATCH 3/7] media: atomisp: fix VIDIOC_S_FMT logic Mauro Carvalho Chehab
2021-11-04 12:05 ` [PATCH 4/7] media: atomisp: fix enum_fmt logic Mauro Carvalho Chehab
2021-11-04 12:05 ` Mauro Carvalho Chehab [this message]
2021-11-04 12:05 ` [PATCH 6/7] media: atomisp: fix try_fmt logic Mauro Carvalho Chehab
2021-11-04 12:05 ` [PATCH 7/7] media: atomisp: fix g_fmt logic Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=75e35d0ea4b6ee7f47bbed61f2eb258a07bcd01f.1636026959.git.mchehab+huawei@kernel.org \
--to=mchehab+huawei@kernel.org \
--cc=arnd@arndb.de \
--cc=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=kitakar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linuxarm@huawei.com \
--cc=mauro.chehab@huawei.com \
--cc=mchehab@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®