From: David Ellingsworth <david@identd.dyndns.org>
To: linux-media@vger.kernel.org
Cc: Markus Demleitner <msdemlei@tucana.harvard.edu>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
David Ellingsworth <david@identd.dyndns.org>
Subject: [PATCH/RFC v2 8/8] dsbr100: simplify access to radio device
Date: Thu, 27 May 2010 12:39:16 -0400 [thread overview]
Message-ID: <1274978356-25836-9-git-send-email-david@identd.dyndns.org> (raw)
In-Reply-To: <[PATCH/RFC 0/7] dsbr100: driver cleanup>
This patch replaces calls to video_drvdata with
references to struct file->private_data which is
set during usb_dsbr100_open. This value is passed
by video_ioctl2 via the *priv argument and is
accessible via file->private_data otherwise.
Signed-off-by: David Ellingsworth <david@identd.dyndns.org>
---
drivers/media/radio/dsbr100.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c
index 81e6aa5..a8c3d5a 100644
--- a/drivers/media/radio/dsbr100.c
+++ b/drivers/media/radio/dsbr100.c
@@ -366,7 +366,7 @@ static void usb_dsbr100_disconnect(struct usb_interface *intf)
static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *v)
{
- struct dsbr100_device *radio = video_drvdata(file);
+ struct dsbr100_device *radio = priv;
strlcpy(v->driver, "dsbr100", sizeof(v->driver));
strlcpy(v->card, "D-Link R-100 USB FM Radio", sizeof(v->card));
@@ -379,7 +379,7 @@ static int vidioc_querycap(struct file *file, void *priv,
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
- struct dsbr100_device *radio = video_drvdata(file);
+ struct dsbr100_device *radio = priv;
if (v->index > 0)
return -EINVAL;
@@ -411,7 +411,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
- struct dsbr100_device *radio = video_drvdata(file);
+ struct dsbr100_device *radio = priv;
int retval = dsbr100_setfreq(radio, f->frequency);
if (retval < 0)
@@ -423,7 +423,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
- struct dsbr100_device *radio = video_drvdata(file);
+ struct dsbr100_device *radio = priv;
f->type = V4L2_TUNER_RADIO;
f->frequency = radio->curfreq;
@@ -444,7 +444,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
- struct dsbr100_device *radio = video_drvdata(file);
+ struct dsbr100_device *radio = priv;
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
@@ -457,7 +457,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
- struct dsbr100_device *radio = video_drvdata(file);
+ struct dsbr100_device *radio = priv;
int retval;
switch (ctrl->id) {
@@ -518,7 +518,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
static long usb_dsbr100_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
- struct dsbr100_device *radio = video_drvdata(file);
+ struct dsbr100_device *radio = file->private_data;
long retval = 0;
mutex_lock(&radio->lock);
@@ -556,6 +556,7 @@ static int usb_dsbr100_open(struct file *file)
radio->status |= INITIALIZED;
}
+ file->private_data = radio;
unlock:
mutex_unlock(&radio->lock);
return retval;
--
1.7.1
prev parent reply other threads:[~2010-05-27 16:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <[PATCH/RFC 0/7] dsbr100: driver cleanup>
2010-05-27 16:39 ` [PATCH/RFC v2 0/8] dsbr100: driver cleanup and fixes David Ellingsworth
2010-07-07 22:19 ` David Ellingsworth
2010-09-14 14:56 ` David Ellingsworth
2010-09-14 15:25 ` Douglas Schilling Landgraf
2010-10-01 12:43 ` David Ellingsworth
2010-10-01 13:17 ` Bjørn Mork
2010-05-27 16:39 ` [PATCH/RFC v2 1/8] dsbr100: implement proper locking David Ellingsworth
2010-05-27 16:39 ` [PATCH/RFC v2 2/8] dsbr100: fix potential use after free David Ellingsworth
2010-05-27 16:39 ` [PATCH/RFC v2 3/8] dsbr100: only change frequency upon success David Ellingsworth
2010-05-27 16:39 ` [PATCH/RFC v2 4/8] dsbr100: remove disconnected indicator David Ellingsworth
2010-05-27 16:39 ` [PATCH/RFC v2 5/8] dsbr100: cleanup return value of start/stop handlers David Ellingsworth
2010-05-27 16:39 ` [PATCH/RFC v2 6/8] dsbr100: properly initialize the radio David Ellingsworth
2010-05-27 16:39 ` [PATCH/RFC v2 7/8] dsbr100: cleanup usb probe routine David Ellingsworth
2010-05-27 16:39 ` David Ellingsworth [this message]
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=1274978356-25836-9-git-send-email-david@identd.dyndns.org \
--to=david@identd.dyndns.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=msdemlei@tucana.harvard.edu \
/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;
as well as URLs for NNTP newsgroup(s).