提交 26452bfe 编写于 作者: D David Ellingsworth 提交者: Mauro Carvalho Chehab

V4L/DVB (13066): radio-mr800: remove device removed indicator

Remove device removed indicator
Signed-off-by: NDavid Ellingsworth <david@identd.dyndns.org>
Acked-by: NAlexey Klimov <klimov.linux@gmail.com>
Signed-off-by: NDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 eac000a9
...@@ -137,7 +137,6 @@ struct amradio_device { ...@@ -137,7 +137,6 @@ struct amradio_device {
int curfreq; int curfreq;
int stereo; int stereo;
int users; int users;
int removed;
int muted; int muted;
}; };
...@@ -270,7 +269,7 @@ static void usb_amradio_disconnect(struct usb_interface *intf) ...@@ -270,7 +269,7 @@ static void usb_amradio_disconnect(struct usb_interface *intf)
struct amradio_device *radio = usb_get_intfdata(intf); struct amradio_device *radio = usb_get_intfdata(intf);
mutex_lock(&radio->lock); mutex_lock(&radio->lock);
radio->removed = 1; radio->usbdev = NULL;
mutex_unlock(&radio->lock); mutex_unlock(&radio->lock);
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
...@@ -488,7 +487,7 @@ static int usb_amradio_open(struct file *file) ...@@ -488,7 +487,7 @@ static int usb_amradio_open(struct file *file)
mutex_lock(&radio->lock); mutex_lock(&radio->lock);
if (radio->removed) { if (!radio->usbdev) {
retval = -EIO; retval = -EIO;
goto unlock; goto unlock;
} }
...@@ -528,19 +527,17 @@ static int usb_amradio_close(struct file *file) ...@@ -528,19 +527,17 @@ static int usb_amradio_close(struct file *file)
mutex_lock(&radio->lock); mutex_lock(&radio->lock);
if (radio->removed) { if (!radio->usbdev) {
retval = -EIO; retval = -EIO;
goto unlock; goto unlock;
} }
radio->users = 0; radio->users = 0;
if (!radio->removed) { retval = amradio_set_mute(radio, AMRADIO_STOP);
retval = amradio_set_mute(radio, AMRADIO_STOP); if (retval < 0)
if (retval < 0) amradio_dev_warn(&radio->videodev.dev,
amradio_dev_warn(&radio->videodev.dev, "amradio_stop failed\n");
"amradio_stop failed\n");
}
unlock: unlock:
mutex_unlock(&radio->lock); mutex_unlock(&radio->lock);
...@@ -555,7 +552,7 @@ static long usb_amradio_ioctl(struct file *file, unsigned int cmd, ...@@ -555,7 +552,7 @@ static long usb_amradio_ioctl(struct file *file, unsigned int cmd,
mutex_lock(&radio->lock); mutex_lock(&radio->lock);
if (radio->removed) { if (!radio->usbdev) {
retval = -EIO; retval = -EIO;
goto unlock; goto unlock;
} }
...@@ -673,7 +670,6 @@ static int usb_amradio_probe(struct usb_interface *intf, ...@@ -673,7 +670,6 @@ static int usb_amradio_probe(struct usb_interface *intf,
radio->videodev.ioctl_ops = &usb_amradio_ioctl_ops; radio->videodev.ioctl_ops = &usb_amradio_ioctl_ops;
radio->videodev.release = usb_amradio_video_device_release; radio->videodev.release = usb_amradio_video_device_release;
radio->removed = 0;
radio->users = 0; radio->users = 0;
radio->usbdev = interface_to_usbdev(intf); radio->usbdev = interface_to_usbdev(intf);
radio->curfreq = 95.16 * FREQ_MUL; radio->curfreq = 95.16 * FREQ_MUL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册