diff options
author | David Ellingsworth <david@identd.dyndns.org> | 2009-09-23 16:52:17 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:40:09 -0500 |
commit | 26452bfef4ae4798b96281ad8d3aed6e2d79846e (patch) | |
tree | 68375ebfca347207ed1c4ccc5e3d51db71c55ece /drivers/media/radio | |
parent | eac000a90e70b990c7d847ac40ff1c33a5f00636 (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.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 0498c4c60d8c..c4f4cd8dbb6c 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c | |||
@@ -137,7 +137,6 @@ struct amradio_device { | |||
137 | int curfreq; | 137 | int curfreq; |
138 | int stereo; | 138 | int stereo; |
139 | int users; | 139 | int users; |
140 | int removed; | ||
141 | int muted; | 140 | int muted; |
142 | }; | 141 | }; |
143 | 142 | ||
@@ -270,7 +269,7 @@ static void usb_amradio_disconnect(struct usb_interface *intf) | |||
270 | struct amradio_device *radio = usb_get_intfdata(intf); | 269 | struct amradio_device *radio = usb_get_intfdata(intf); |
271 | 270 | ||
272 | mutex_lock(&radio->lock); | 271 | mutex_lock(&radio->lock); |
273 | radio->removed = 1; | 272 | radio->usbdev = NULL; |
274 | mutex_unlock(&radio->lock); | 273 | mutex_unlock(&radio->lock); |
275 | 274 | ||
276 | usb_set_intfdata(intf, NULL); | 275 | usb_set_intfdata(intf, NULL); |
@@ -488,7 +487,7 @@ static int usb_amradio_open(struct file *file) | |||
488 | 487 | ||
489 | mutex_lock(&radio->lock); | 488 | mutex_lock(&radio->lock); |
490 | 489 | ||
491 | if (radio->removed) { | 490 | if (!radio->usbdev) { |
492 | retval = -EIO; | 491 | retval = -EIO; |
493 | goto unlock; | 492 | goto unlock; |
494 | } | 493 | } |
@@ -528,19 +527,17 @@ static int usb_amradio_close(struct file *file) | |||
528 | 527 | ||
529 | mutex_lock(&radio->lock); | 528 | mutex_lock(&radio->lock); |
530 | 529 | ||
531 | if (radio->removed) { | 530 | if (!radio->usbdev) { |
532 | retval = -EIO; | 531 | retval = -EIO; |
533 | goto unlock; | 532 | goto unlock; |
534 | } | 533 | } |
535 | 534 | ||
536 | radio->users = 0; | 535 | radio->users = 0; |
537 | 536 | ||
538 | if (!radio->removed) { | 537 | retval = amradio_set_mute(radio, AMRADIO_STOP); |
539 | retval = amradio_set_mute(radio, AMRADIO_STOP); | 538 | if (retval < 0) |
540 | if (retval < 0) | 539 | amradio_dev_warn(&radio->videodev.dev, |
541 | amradio_dev_warn(&radio->videodev.dev, | 540 | "amradio_stop failed\n"); |
542 | "amradio_stop failed\n"); | ||
543 | } | ||
544 | 541 | ||
545 | unlock: | 542 | unlock: |
546 | mutex_unlock(&radio->lock); | 543 | mutex_unlock(&radio->lock); |
@@ -555,7 +552,7 @@ static long usb_amradio_ioctl(struct file *file, unsigned int cmd, | |||
555 | 552 | ||
556 | mutex_lock(&radio->lock); | 553 | mutex_lock(&radio->lock); |
557 | 554 | ||
558 | if (radio->removed) { | 555 | if (!radio->usbdev) { |
559 | retval = -EIO; | 556 | retval = -EIO; |
560 | goto unlock; | 557 | goto unlock; |
561 | } | 558 | } |
@@ -673,7 +670,6 @@ static int usb_amradio_probe(struct usb_interface *intf, | |||
673 | radio->videodev.ioctl_ops = &usb_amradio_ioctl_ops; | 670 | radio->videodev.ioctl_ops = &usb_amradio_ioctl_ops; |
674 | radio->videodev.release = usb_amradio_video_device_release; | 671 | radio->videodev.release = usb_amradio_video_device_release; |
675 | 672 | ||
676 | radio->removed = 0; | ||
677 | radio->users = 0; | 673 | radio->users = 0; |
678 | radio->usbdev = interface_to_usbdev(intf); | 674 | radio->usbdev = interface_to_usbdev(intf); |
679 | radio->curfreq = 95.16 * FREQ_MUL; | 675 | radio->curfreq = 95.16 * FREQ_MUL; |