summaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorDavid Ellingsworth <david@identd.dyndns.org>2009-09-23 17:52:17 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 18:40:09 -0200
commit26452bfef4ae4798b96281ad8d3aed6e2d79846e (patch)
tree68375ebfca347207ed1c4ccc5e3d51db71c55ece /drivers/media/radio
parenteac000a90e70b990c7d847ac40ff1c33a5f00636 (diff)
V4L/DVB (13066): radio-mr800: remove device removed indicator
Remove device removed indicator Signed-off-by: David Ellingsworth <david@identd.dyndns.org> Acked-by: Alexey Klimov <klimov.linux@gmail.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r--drivers/media/radio/radio-mr800.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 0498c4c60d8..c4f4cd8dbb6 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;