int curfreq;
int stereo;
int users;
- int removed;
int muted;
};
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);
mutex_lock(&radio->lock);
- if (radio->removed) {
+ if (!radio->usbdev) {
retval = -EIO;
goto unlock;
}
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);
mutex_lock(&radio->lock);
- if (radio->removed) {
+ if (!radio->usbdev) {
retval = -EIO;
goto unlock;
}
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;