From: Frederic Weisbecker <fweisbec@gmail.com>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Hans Verkuil <hverkuil@xs4all.nl>, Arnd Bergmann <arnd@arndb.de>,
John Kacur <jkacur@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Jan Blunck <jblunck@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH 1/4] v4l: Introduce video_ioctl2_bkl
Date: Mon, 17 May 2010 08:50:49 +0200 [thread overview]
Message-ID: <1274079052-23611-2-git-send-regression-fweisbec@gmail.com> (raw)
In-Reply-To: <1274079052-23611-1-git-send-regression-fweisbec@gmail.com>
video_ioctl2 is a generic ioctl helper used by a lot of drivers.
Most of them put it as their bkl'ed .ioctl callback, then provide
a bkl'ed version of this helper so that drivers can use it as an
unlocked_ioctl callback, making it easy to remove the .ioctl
field from the v4l fops.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
drivers/media/video/v4l2-ioctl.c | 14 ++++++++++++++
include/media/v4l2-ioctl.h | 3 +++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 0eeceae..154258e 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -16,6 +16,7 @@
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/kernel.h>
+#include <linux/smp_lock.h>
#define __OLD_VIDIOC_ /* To allow fixing old calls */
#include <linux/videodev.h>
@@ -2156,3 +2157,16 @@ out:
return err;
}
EXPORT_SYMBOL(video_ioctl2);
+
+
+long video_ioctl2_bkl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+ long ret;
+
+ lock_kernel();
+ ret = video_ioctl2(file, cmd, arg);
+ unlock_kernel();
+
+ return ret;
+}
+EXPORT_SYMBOL(video_ioctl2_bkl);
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 06daa6e..a128ed4 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -324,4 +324,7 @@ extern long video_usercopy(struct file *file, unsigned int cmd,
extern long video_ioctl2(struct file *file,
unsigned int cmd, unsigned long arg);
+extern long video_ioctl2_bkl(struct file *file,
+ unsigned int cmd, unsigned long arg);
+
#endif /* _V4L2_IOCTL_H */
--
1.6.2.3
next prev parent reply other threads:[~2010-05-17 6:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-17 6:50 [PATCH 0/4 v2] V4l bkl ioctl pushdown Frederic Weisbecker
2010-05-17 6:50 ` Frederic Weisbecker [this message]
2010-05-17 6:50 ` [PATCH 2/4] v4l: Convert video_ioctl2 to video_ioctl2_bkl for users that need the bkl Frederic Weisbecker
2010-05-17 6:50 ` [PATCH 3/4] v4l: Pushdown bkl to drivers that implement their own ioctl Frederic Weisbecker
2010-05-18 6:47 ` Hans Verkuil
2010-05-17 6:50 ` [PATCH 4/4] v4l: Remove struct v4l2_file_operations::ioctl Frederic Weisbecker
2010-05-18 6:50 ` [PATCH 0/4 v2] V4l bkl ioctl pushdown Hans Verkuil
2010-05-19 10:55 ` Frederic Weisbecker
2010-05-19 11:38 [PATCH 0/4 v3] " Frederic Weisbecker
2010-05-19 11:38 ` [PATCH 1/4] v4l: Introduce video_ioctl2_bkl Frederic Weisbecker
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=1274079052-23611-2-git-send-regression-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arnd@arndb.de \
--cc=hverkuil@xs4all.nl \
--cc=jblunck@gmail.com \
--cc=jkacur@redhat.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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®