diff mbox

[PATCH/RFC,v2,4/8] dsbr100: remove disconnected indicator

Message ID 1274978356-25836-5-git-send-email-david@identd.dyndns.org (mailing list archive)
State RFC
Headers show

Commit Message

David Ellingsworth May 27, 2010, 4:39 p.m. UTC
None
diff mbox

Patch

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;