From patchwork Thu May 27 16:39:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ellingsworth X-Patchwork-Id: 102732 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 o4RGewY5023623 for ; Thu, 27 May 2010 16:40:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757775Ab0E0Qkz (ORCPT ); Thu, 27 May 2010 12:40:55 -0400 Received: from 99-34-136-231.lightspeed.bcvloh.sbcglobal.net ([99.34.136.231]:41827 "EHLO desource.dyndns.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757459Ab0E0Qku (ORCPT ); Thu, 27 May 2010 12:40:50 -0400 Received: from root by desource.dyndns.org with local (Exim 4.71) (envelope-from ) id 1OHg7X-0006kH-6F; Thu, 27 May 2010 12:39:47 -0400 From: David Ellingsworth To: linux-media@vger.kernel.org Cc: Markus Demleitner , Mauro Carvalho Chehab , David Ellingsworth Subject: [PATCH/RFC v2 4/8] dsbr100: remove disconnected indicator Date: Thu, 27 May 2010 12:39:12 -0400 Message-Id: <1274978356-25836-5-git-send-email-david@identd.dyndns.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <[PATCH/RFC 0/7] dsbr100: driver cleanup> References: <[PATCH/RFC 0/7] dsbr100: driver cleanup> X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: linux-media@vger.kernel.org, msdemlei@tucana.harvard.edu, mchehab@infradead.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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 27 May 2010 16:40:58 +0000 (UTC) diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c index b62fe40..c949ace 100644 --- a/drivers/media/radio/dsbr100.c +++ b/drivers/media/radio/dsbr100.c @@ -151,7 +151,6 @@ struct dsbr100_device { struct mutex lock; /* buffer locking */ int curfreq; int stereo; - int removed; int status; }; @@ -353,7 +352,7 @@ static void usb_dsbr100_disconnect(struct usb_interface *intf) usb_set_intfdata (intf, NULL); mutex_lock(&radio->lock); - radio->removed = 1; + radio->usbdev = NULL; mutex_unlock(&radio->lock); v4l2_device_disconnect(&radio->v4l2_dev); @@ -521,7 +520,7 @@ static long usb_dsbr100_ioctl(struct file *file, unsigned int cmd, mutex_lock(&radio->lock); - if (radio->removed) { + if (!radio->usbdev) { retval = -EIO; goto unlock; } @@ -649,7 +648,6 @@ static int usb_dsbr100_probe(struct usb_interface *intf, mutex_init(&radio->lock); - radio->removed = 0; radio->usbdev = interface_to_usbdev(intf); radio->curfreq = FREQ_MIN * FREQ_MUL; radio->status = STOPPED;