From patchwork Thu May 28 20:44:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Klimov X-Patchwork-Id: 26786 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4SKj2pT000761 for ; Thu, 28 May 2009 20:45:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759177AbZE1Uol (ORCPT ); Thu, 28 May 2009 16:44:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760302AbZE1Uol (ORCPT ); Thu, 28 May 2009 16:44:41 -0400 Received: from fg-out-1718.google.com ([72.14.220.157]:56843 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759177AbZE1Uok (ORCPT ); Thu, 28 May 2009 16:44:40 -0400 Received: by fg-out-1718.google.com with SMTP id d23so1612889fga.17 for ; Thu, 28 May 2009 13:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=91SfDPWipV5izodBF7r8u81vw7MbZtPhIIVagbhoMco=; b=kFLdGfcBYsXwb5UuVefVnV4c3o1G+QfSRQ/4ufytNMA5R/mlBlcoEuCdsB4m7WYDew I53QWOJbnhfptleoqGeZz9zBmPUpRuamkFaSrVXpp/CVYPnETntwg2YFOf6kcbw0lMBA Fy1lthrM/56IgXWiGfZkB1iAxFHJW4LfmU8ao= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=SlelyLyWoQi000VdkEeshD1h9voZ13nW7gxxc+WiTk8Wdp+WERJHnXEw8llUtJb1gf Q9ITrGcv2zR4YQS3dkLeno7eplTdeM4TCBvpIXUOX3bsvrH4oxtQpkzSO64J8WFHskZq ztvIS4MrApCyvQL+HAbZBqiCxH39pgO6s9jV4= Received: by 10.86.93.19 with SMTP id q19mr1977966fgb.55.1243543481759; Thu, 28 May 2009 13:44:41 -0700 (PDT) Received: from ?192.168.1.102? (gw.zunet.ru [217.67.117.64]) by mx.google.com with ESMTPS id 4sm895689fgg.28.2009.05.28.13.44.40 (version=SSLv3 cipher=RC4-MD5); Thu, 28 May 2009 13:44:40 -0700 (PDT) Subject: [patch review 2/4] dsbr100: remove usb_dsbr100_open/close calls From: Alexey Klimov To: Linux Media Cc: Douglas Schilling Landgraf Date: Fri, 29 May 2009 00:44:42 +0400 Message-Id: <1243543482.6713.42.camel@tux.localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Patch removes usb_dsbr100_open and usb_dsbr100_close calls. 1. No need to start, set frequency, adjust parameters in open call. 2. This patch tackles issue with lock/unlock_kernel() in open call. 3. With this patch feature "Mute on exit?" in gnomeradio works. Signed-off-by: Alexey Klimov diff -r 5abb9dbc58d1 linux/drivers/media/radio/dsbr100.c --- a/linux/drivers/media/radio/dsbr100.c Tue May 19 15:05:21 2009 +0400 +++ b/linux/drivers/media/radio/dsbr100.c Tue May 19 15:18:49 2009 +0400 @@ -127,8 +127,6 @@ static int usb_dsbr100_probe(struct usb_interface *intf, const struct usb_device_id *id); static void usb_dsbr100_disconnect(struct usb_interface *intf); -static int usb_dsbr100_open(struct file *file); -static int usb_dsbr100_close(struct file *file); static int usb_dsbr100_suspend(struct usb_interface *intf, pm_message_t message); static int usb_dsbr100_resume(struct usb_interface *intf); @@ -545,50 +543,6 @@ return 0; } -static int usb_dsbr100_open(struct file *file) -{ - struct dsbr100_device *radio = video_drvdata(file); - int retval; - - lock_kernel(); - radio->muted = 1; - - retval = dsbr100_start(radio); - if (retval < 0) { - dev_warn(&radio->usbdev->dev, - "Radio did not start up properly\n"); - unlock_kernel(); - return -EIO; - } - - retval = dsbr100_setfreq(radio, radio->curfreq); - if (retval < 0) - dev_warn(&radio->usbdev->dev, - "set frequency failed\n"); - - unlock_kernel(); - return 0; -} - -static int usb_dsbr100_close(struct file *file) -{ - struct dsbr100_device *radio = video_drvdata(file); - int retval; - - if (!radio) - return -ENODEV; - - if (!radio->removed) { - retval = dsbr100_stop(radio); - if (retval < 0) { - dev_warn(&radio->usbdev->dev, - "dsbr100_stop failed\n"); - } - - } - return 0; -} - /* Suspend device - stop device. */ static int usb_dsbr100_suspend(struct usb_interface *intf, pm_message_t message) { @@ -632,8 +586,6 @@ /* File system interface */ static const struct v4l2_file_operations usb_dsbr100_fops = { .owner = THIS_MODULE, - .open = usb_dsbr100_open, - .release = usb_dsbr100_close, .ioctl = video_ioctl2, };