提交 cf9b475d 编写于 作者: M Mauro Carvalho Chehab

V4L/DVB: radio-si470x: remove the BKL lock used internally at the driver

Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 e69e34e9
...@@ -517,7 +517,7 @@ int si470x_fops_open(struct file *file) ...@@ -517,7 +517,7 @@ int si470x_fops_open(struct file *file)
struct si470x_device *radio = video_drvdata(file); struct si470x_device *radio = video_drvdata(file);
int retval; int retval;
lock_kernel(); mutex_lock(&radio->lock);
radio->users++; radio->users++;
retval = usb_autopm_get_interface(radio->intf); retval = usb_autopm_get_interface(radio->intf);
...@@ -558,7 +558,7 @@ int si470x_fops_open(struct file *file) ...@@ -558,7 +558,7 @@ int si470x_fops_open(struct file *file)
} }
done: done:
unlock_kernel(); mutex_unlock(&radio->lock);
return retval; return retval;
} }
...@@ -577,7 +577,7 @@ int si470x_fops_release(struct file *file) ...@@ -577,7 +577,7 @@ int si470x_fops_release(struct file *file)
goto done; goto done;
} }
mutex_lock(&radio->disconnect_lock); mutex_lock(&radio->lock);
radio->users--; radio->users--;
if (radio->users == 0) { if (radio->users == 0) {
/* shutdown interrupt handler */ /* shutdown interrupt handler */
...@@ -591,7 +591,7 @@ int si470x_fops_release(struct file *file) ...@@ -591,7 +591,7 @@ int si470x_fops_release(struct file *file)
video_unregister_device(radio->videodev); video_unregister_device(radio->videodev);
kfree(radio->int_in_buffer); kfree(radio->int_in_buffer);
kfree(radio->buffer); kfree(radio->buffer);
mutex_unlock(&radio->disconnect_lock); mutex_unlock(&radio->lock);
kfree(radio); kfree(radio);
goto done; goto done;
} }
...@@ -603,7 +603,7 @@ int si470x_fops_release(struct file *file) ...@@ -603,7 +603,7 @@ int si470x_fops_release(struct file *file)
retval = si470x_stop(radio); retval = si470x_stop(radio);
usb_autopm_put_interface(radio->intf); usb_autopm_put_interface(radio->intf);
} }
mutex_unlock(&radio->disconnect_lock); mutex_unlock(&radio->lock);
done: done:
return retval; return retval;
} }
...@@ -661,7 +661,6 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, ...@@ -661,7 +661,6 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
radio->disconnected = 0; radio->disconnected = 0;
radio->usbdev = interface_to_usbdev(intf); radio->usbdev = interface_to_usbdev(intf);
radio->intf = intf; radio->intf = intf;
mutex_init(&radio->disconnect_lock);
mutex_init(&radio->lock); mutex_init(&radio->lock);
iface_desc = intf->cur_altsetting; iface_desc = intf->cur_altsetting;
...@@ -830,7 +829,7 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf) ...@@ -830,7 +829,7 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf)
{ {
struct si470x_device *radio = usb_get_intfdata(intf); struct si470x_device *radio = usb_get_intfdata(intf);
mutex_lock(&radio->disconnect_lock); mutex_lock(&radio->lock);
radio->disconnected = 1; radio->disconnected = 1;
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
if (radio->users == 0) { if (radio->users == 0) {
...@@ -843,10 +842,10 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf) ...@@ -843,10 +842,10 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf)
kfree(radio->int_in_buffer); kfree(radio->int_in_buffer);
video_unregister_device(radio->videodev); video_unregister_device(radio->videodev);
kfree(radio->buffer); kfree(radio->buffer);
mutex_unlock(&radio->disconnect_lock); mutex_unlock(&radio->lock);
kfree(radio); kfree(radio);
} else { } else {
mutex_unlock(&radio->disconnect_lock); mutex_unlock(&radio->lock);
} }
} }
......
...@@ -177,7 +177,6 @@ struct si470x_device { ...@@ -177,7 +177,6 @@ struct si470x_device {
/* driver management */ /* driver management */
unsigned char disconnected; unsigned char disconnected;
struct mutex disconnect_lock;
#endif #endif
#if defined(CONFIG_I2C_SI470X) || defined(CONFIG_I2C_SI470X_MODULE) #if defined(CONFIG_I2C_SI470X) || defined(CONFIG_I2C_SI470X_MODULE)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册