diff options
author | David Ellingsworth <david@identd.dyndns.org> | 2009-09-23 17:09:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:40:10 -0500 |
commit | 8a7cd16f1fa31ef6db9cfc16b1eb0356566e974d (patch) | |
tree | 5aaced0fe7c42a99ca5d8515d3a888aee56e647d /drivers/media/radio/radio-mr800.c | |
parent | 4e3616576e9e65d53f9381b9f334257299c7262e (diff) |
V4L/DVB (13068): radio-mr800: remove device initialization from open/close
Remove device initialization from open/close.
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/radio-mr800.c')
-rw-r--r-- | drivers/media/radio/radio-mr800.c | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index dbae50ba250c..399032e8cc18 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c | |||
@@ -136,7 +136,6 @@ struct amradio_device { | |||
136 | struct mutex lock; /* buffer locking */ | 136 | struct mutex lock; /* buffer locking */ |
137 | int curfreq; | 137 | int curfreq; |
138 | int stereo; | 138 | int stereo; |
139 | int users; | ||
140 | int muted; | 139 | int muted; |
141 | }; | 140 | }; |
142 | 141 | ||
@@ -493,26 +492,6 @@ static int usb_amradio_open(struct file *file) | |||
493 | } | 492 | } |
494 | 493 | ||
495 | file->private_data = radio; | 494 | file->private_data = radio; |
496 | radio->users = 1; | ||
497 | radio->muted = 1; | ||
498 | |||
499 | retval = amradio_set_mute(radio, AMRADIO_START); | ||
500 | if (retval < 0) { | ||
501 | amradio_dev_warn(&radio->videodev.dev, | ||
502 | "radio did not start up properly\n"); | ||
503 | radio->users = 0; | ||
504 | goto unlock; | ||
505 | } | ||
506 | |||
507 | retval = amradio_set_stereo(radio, WANT_STEREO); | ||
508 | if (retval < 0) | ||
509 | amradio_dev_warn(&radio->videodev.dev, | ||
510 | "set stereo failed\n"); | ||
511 | |||
512 | retval = amradio_setfreq(radio, radio->curfreq); | ||
513 | if (retval < 0) | ||
514 | amradio_dev_warn(&radio->videodev.dev, | ||
515 | "set frequency failed\n"); | ||
516 | 495 | ||
517 | unlock: | 496 | unlock: |
518 | mutex_unlock(&radio->lock); | 497 | mutex_unlock(&radio->lock); |
@@ -527,19 +506,9 @@ static int usb_amradio_close(struct file *file) | |||
527 | 506 | ||
528 | mutex_lock(&radio->lock); | 507 | mutex_lock(&radio->lock); |
529 | 508 | ||
530 | if (!radio->usbdev) { | 509 | if (!radio->usbdev) |
531 | retval = -EIO; | 510 | retval = -EIO; |
532 | goto unlock; | ||
533 | } | ||
534 | |||
535 | radio->users = 0; | ||
536 | 511 | ||
537 | retval = amradio_set_mute(radio, AMRADIO_STOP); | ||
538 | if (retval < 0) | ||
539 | amradio_dev_warn(&radio->videodev.dev, | ||
540 | "amradio_stop failed\n"); | ||
541 | |||
542 | unlock: | ||
543 | mutex_unlock(&radio->lock); | 512 | mutex_unlock(&radio->lock); |
544 | return retval; | 513 | return retval; |
545 | } | 514 | } |
@@ -670,10 +639,10 @@ static int usb_amradio_probe(struct usb_interface *intf, | |||
670 | radio->videodev.ioctl_ops = &usb_amradio_ioctl_ops; | 639 | radio->videodev.ioctl_ops = &usb_amradio_ioctl_ops; |
671 | radio->videodev.release = usb_amradio_video_device_release; | 640 | radio->videodev.release = usb_amradio_video_device_release; |
672 | 641 | ||
673 | radio->users = 0; | ||
674 | radio->usbdev = interface_to_usbdev(intf); | 642 | radio->usbdev = interface_to_usbdev(intf); |
675 | radio->curfreq = 95.16 * FREQ_MUL; | 643 | radio->curfreq = 95.16 * FREQ_MUL; |
676 | radio->stereo = -1; | 644 | radio->stereo = -1; |
645 | radio->muted = 1; | ||
677 | 646 | ||
678 | mutex_init(&radio->lock); | 647 | mutex_init(&radio->lock); |
679 | 648 | ||