diff options
Diffstat (limited to 'drivers/media/radio/si470x/radio-si470x-usb.c')
-rw-r--r-- | drivers/media/radio/si470x/radio-si470x-usb.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index 5ec13e50a9f0..392e84fe90ef 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c @@ -517,7 +517,7 @@ int si470x_fops_open(struct file *file) struct si470x_device *radio = video_drvdata(file); int retval; - lock_kernel(); + mutex_lock(&radio->lock); radio->users++; retval = usb_autopm_get_interface(radio->intf); @@ -558,7 +558,7 @@ int si470x_fops_open(struct file *file) } done: - unlock_kernel(); + mutex_unlock(&radio->lock); return retval; } @@ -577,7 +577,7 @@ int si470x_fops_release(struct file *file) goto done; } - mutex_lock(&radio->disconnect_lock); + mutex_lock(&radio->lock); radio->users--; if (radio->users == 0) { /* shutdown interrupt handler */ @@ -591,7 +591,7 @@ int si470x_fops_release(struct file *file) video_unregister_device(radio->videodev); kfree(radio->int_in_buffer); kfree(radio->buffer); - mutex_unlock(&radio->disconnect_lock); + mutex_unlock(&radio->lock); kfree(radio); goto done; } @@ -603,7 +603,7 @@ int si470x_fops_release(struct file *file) retval = si470x_stop(radio); usb_autopm_put_interface(radio->intf); } - mutex_unlock(&radio->disconnect_lock); + mutex_unlock(&radio->lock); done: return retval; } @@ -661,7 +661,6 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, radio->disconnected = 0; radio->usbdev = interface_to_usbdev(intf); radio->intf = intf; - mutex_init(&radio->disconnect_lock); mutex_init(&radio->lock); iface_desc = intf->cur_altsetting; @@ -830,7 +829,7 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf) { struct si470x_device *radio = usb_get_intfdata(intf); - mutex_lock(&radio->disconnect_lock); + mutex_lock(&radio->lock); radio->disconnected = 1; usb_set_intfdata(intf, NULL); if (radio->users == 0) { @@ -843,10 +842,10 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf) kfree(radio->int_in_buffer); video_unregister_device(radio->videodev); kfree(radio->buffer); - mutex_unlock(&radio->disconnect_lock); + mutex_unlock(&radio->lock); kfree(radio); } else { - mutex_unlock(&radio->disconnect_lock); + mutex_unlock(&radio->lock); } } |