From patchwork Sat Sep 12 14:49:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ellingsworth X-Patchwork-Id: 47078 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 n8CEnnVM027544 for ; Sat, 12 Sep 2009 14:50:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754633AbZILOuE (ORCPT ); Sat, 12 Sep 2009 10:50:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754626AbZILOuE (ORCPT ); Sat, 12 Sep 2009 10:50:04 -0400 Received: from mail-qy0-f172.google.com ([209.85.221.172]:50386 "EHLO mail-qy0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754620AbZILOuC (ORCPT ); Sat, 12 Sep 2009 10:50:02 -0400 Received: by mail-qy0-f172.google.com with SMTP id 2so1629968qyk.21 for ; Sat, 12 Sep 2009 07:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :reply-to:user-agent:mime-version:to:subject:content-type; bh=P1elyqazmKyHwbXQRk68S0G9ohu0pD16+sT/a9c5X6c=; b=nQCIkG4zlyIzNEDa0bDoHLgIYfanqaX+CXM+lX8aNLOmxSX1OPy3UrQs/E2aLDdm7p KJ0jsFJ26OqGCPADIEl5GMQzXiq1l0R1uFGdX76D+d2noy+uZAR2nHWUKxMkpGI1cWMS qoZJVrid/hYDL/6fbQ/xWdUii7cntb5J2izX8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to :subject:content-type; b=nr0EAlkm0ufSCp7Ex2eiCustgEJSUqCP6CpJTfiShL0vCt10xb3qqxEsonMOgnaxOP 2H2sOFvwWoBiMlmP24XhpTDpif9v1Lch0HL1qIs/cgZW9PCHQTd+Edbux3ahT7tUe7gq WADRKYD7elmw7xS1wnTQjQA5F2Xe4l8GJyAys= Received: by 10.224.80.91 with SMTP id s27mr3744810qak.271.1252767002040; Sat, 12 Sep 2009 07:50:02 -0700 (PDT) Received: from ?192.168.10.110? (cpe-71-72-62-249.neo.res.rr.com [71.72.62.249]) by mx.google.com with ESMTPS id 6sm2237587qwd.53.2009.09.12.07.50.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 12 Sep 2009 07:50:01 -0700 (PDT) Message-ID: <4AABB511.7060705@gmail.com> Date: Sat, 12 Sep 2009 10:49:53 -0400 From: David Ellingsworth Reply-To: david@identd.dyndns.org User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: linux-media@vger.kernel.org, klimov.linux@gmail.com Subject: [RFC/RFT 07/10] radio-mr800: remove device removed indicator Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From a9b0a308892919514efc692f2a0e28b80ea304ac Mon Sep 17 00:00:00 2001 From: David Ellingsworth Date: Sat, 12 Sep 2009 01:22:57 -0400 Subject: [PATCH 07/10] mr800: remove device removed indicator Signed-off-by: David Ellingsworth --- drivers/media/radio/radio-mr800.c | 20 ++++++++------------ 1 files changed, 8 insertions(+), 12 deletions(-) usb_set_intfdata(intf, NULL); @@ -488,7 +487,7 @@ static int usb_amradio_open(struct file *file) mutex_lock(&radio->lock); - if (radio->removed) { + if (!radio->usbdev) { retval = -EIO; goto unlock; } @@ -528,19 +527,17 @@ static int usb_amradio_close(struct file *file) mutex_lock(&radio->lock); - if (radio->removed) { + if (!radio->usbdev) { retval = -EIO; goto unlock; } radio->users = 0; - if (!radio->removed) { - retval = amradio_set_mute(radio, AMRADIO_STOP); - if (retval < 0) - amradio_dev_warn(&radio->videodev.dev, - "amradio_stop failed\n"); - } + retval = amradio_set_mute(radio, AMRADIO_STOP); + if (retval < 0) + amradio_dev_warn(&radio->videodev.dev, + "amradio_stop failed\n"); unlock: mutex_unlock(&radio->lock); @@ -555,7 +552,7 @@ static long usb_amradio_ioctl(struct file *file, unsigned int cmd, mutex_lock(&radio->lock); - if (radio->removed) { + if (!radio->usbdev) { retval = -EIO; goto unlock; } @@ -673,7 +670,6 @@ static int usb_amradio_probe(struct usb_interface *intf, radio->videodev.ioctl_ops = &usb_amradio_ioctl_ops; radio->videodev.release = usb_amradio_video_device_release; - radio->removed = 0; radio->users = 0; radio->usbdev = interface_to_usbdev(intf); radio->curfreq = 95.16 * FREQ_MUL; From a9b0a308892919514efc692f2a0e28b80ea304ac Mon Sep 17 00:00:00 2001 From: David Ellingsworth Date: Sat, 12 Sep 2009 01:22:57 -0400 Subject: [PATCH 07/10] mr800: remove device removed indicator Signed-off-by: David Ellingsworth --- drivers/media/radio/radio-mr800.c | 20 ++++++++------------ 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index 71d15ba..9fd2342 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c @@ -137,7 +137,6 @@ struct amradio_device { int curfreq; int stereo; int users; - int removed; int muted; }; @@ -270,7 +269,7 @@ static void usb_amradio_disconnect(struct usb_interface *intf) struct amradio_device *radio = usb_get_intfdata(intf); mutex_lock(&radio->lock); - radio->removed = 1; + radio->usbdev = NULL; mutex_unlock(&radio->lock); usb_set_intfdata(intf, NULL); @@ -488,7 +487,7 @@ static int usb_amradio_open(struct file *file) mutex_lock(&radio->lock); - if (radio->removed) { + if (!radio->usbdev) { retval = -EIO; goto unlock; } @@ -528,19 +527,17 @@ static int usb_amradio_close(struct file *file) mutex_lock(&radio->lock); - if (radio->removed) { + if (!radio->usbdev) { retval = -EIO; goto unlock; } radio->users = 0; - if (!radio->removed) { - retval = amradio_set_mute(radio, AMRADIO_STOP); - if (retval < 0) - amradio_dev_warn(&radio->videodev.dev, - "amradio_stop failed\n"); - } + retval = amradio_set_mute(radio, AMRADIO_STOP); + if (retval < 0) + amradio_dev_warn(&radio->videodev.dev, + "amradio_stop failed\n"); unlock: mutex_unlock(&radio->lock); @@ -555,7 +552,7 @@ static long usb_amradio_ioctl(struct file *file, unsigned int cmd, mutex_lock(&radio->lock); - if (radio->removed) { + if (!radio->usbdev) { retval = -EIO; goto unlock; } @@ -673,7 +670,6 @@ static int usb_amradio_probe(struct usb_interface *intf, radio->videodev.ioctl_ops = &usb_amradio_ioctl_ops; radio->videodev.release = usb_amradio_video_device_release; - radio->removed = 0; radio->users = 0; radio->usbdev = interface_to_usbdev(intf); radio->curfreq = 95.16 * FREQ_MUL; -- 1.6.3.3