From patchwork Wed May 5 17:05:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ellingsworth X-Patchwork-Id: 97159 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o45HbqHB010329 for ; Wed, 5 May 2010 17:37:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756565Ab0EERhe (ORCPT ); Wed, 5 May 2010 13:37:34 -0400 Received: from 99-34-136-231.lightspeed.bcvloh.sbcglobal.net ([99.34.136.231]:48159 "EHLO desource.dyndns.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756043Ab0EERhM (ORCPT ); Wed, 5 May 2010 13:37:12 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 05 May 2010 17:37:54 +0000 (UTC) X-Greylist: delayed 1871 seconds by postgrey-1.27 at vger.kernel.org; Wed, 05 May 2010 13:37:12 EDT Received: from root by desource.dyndns.org with local (Exim 4.71) (envelope-from ) id 1O9i2Q-0005mk-Ky; Wed, 05 May 2010 13:05:34 -0400 From: David Ellingsworth To: linux-media@vger.kernel.org Cc: David Ellingsworth Subject: [PATCH/RFC 7/7] dsbr100: simplify access to radio device Date: Wed, 5 May 2010 13:05:30 -0400 Message-Id: <1273079130-21999-8-git-send-email-david@identd.dyndns.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1273079130-21999-1-git-send-email-david@identd.dyndns.org> References: <1273079130-21999-1-git-send-email-david@identd.dyndns.org> X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: linux-media@vger.kernel.org, david@identd.dyndns.org X-SA-Exim-Mail-From: root@desource.dyndns.org X-SA-Exim-Scanned: No (on desource.dyndns.org); SAEximRunCond expanded to false Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c index cd4eed7..64ba0c8 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); @@ -557,6 +557,7 @@ static int usb_dsbr100_open(struct file *file) radio->status |= INITIALIZED; } + file->private_data = radio; unlock: mutex_unlock(&radio->lock); return retval;