diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-09-14 08:56:22 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-20 23:06:12 -0400 |
commit | cf9b475d5f9b58c23aca76b367f8318743d064e9 (patch) | |
tree | 61ef85fc4ae421447b20f782c24882dd2873d5cf /drivers/media/radio/si470x/radio-si470x-usb.c | |
parent | e69e34e9d964b66013dc09a112e6b46def0af1ef (diff) |
V4L/DVB: radio-si470x: remove the BKL lock used internally at the driver
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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) | |||
517 | struct si470x_device *radio = video_drvdata(file); | 517 | struct si470x_device *radio = video_drvdata(file); |
518 | int retval; | 518 | int retval; |
519 | 519 | ||
520 | lock_kernel(); | 520 | mutex_lock(&radio->lock); |
521 | radio->users++; | 521 | radio->users++; |
522 | 522 | ||
523 | retval = usb_autopm_get_interface(radio->intf); | 523 | retval = usb_autopm_get_interface(radio->intf); |
@@ -558,7 +558,7 @@ int si470x_fops_open(struct file *file) | |||
558 | } | 558 | } |
559 | 559 | ||
560 | done: | 560 | done: |
561 | unlock_kernel(); | 561 | mutex_unlock(&radio->lock); |
562 | return retval; | 562 | return retval; |
563 | } | 563 | } |
564 | 564 | ||
@@ -577,7 +577,7 @@ int si470x_fops_release(struct file *file) | |||
577 | goto done; | 577 | goto done; |
578 | } | 578 | } |
579 | 579 | ||
580 | mutex_lock(&radio->disconnect_lock); | 580 | mutex_lock(&radio->lock); |
581 | radio->users--; | 581 | radio->users--; |
582 | if (radio->users == 0) { | 582 | if (radio->users == 0) { |
583 | /* shutdown interrupt handler */ | 583 | /* shutdown interrupt handler */ |
@@ -591,7 +591,7 @@ int si470x_fops_release(struct file *file) | |||
591 | video_unregister_device(radio->videodev); | 591 | video_unregister_device(radio->videodev); |
592 | kfree(radio->int_in_buffer); | 592 | kfree(radio->int_in_buffer); |
593 | kfree(radio->buffer); | 593 | kfree(radio->buffer); |
594 | mutex_unlock(&radio->disconnect_lock); | 594 | mutex_unlock(&radio->lock); |
595 | kfree(radio); | 595 | kfree(radio); |
596 | goto done; | 596 | goto done; |
597 | } | 597 | } |
@@ -603,7 +603,7 @@ int si470x_fops_release(struct file *file) | |||
603 | retval = si470x_stop(radio); | 603 | retval = si470x_stop(radio); |
604 | usb_autopm_put_interface(radio->intf); | 604 | usb_autopm_put_interface(radio->intf); |
605 | } | 605 | } |
606 | mutex_unlock(&radio->disconnect_lock); | 606 | mutex_unlock(&radio->lock); |
607 | done: | 607 | done: |
608 | return retval; | 608 | return retval; |
609 | } | 609 | } |
@@ -661,7 +661,6 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, | |||
661 | radio->disconnected = 0; | 661 | radio->disconnected = 0; |
662 | radio->usbdev = interface_to_usbdev(intf); | 662 | radio->usbdev = interface_to_usbdev(intf); |
663 | radio->intf = intf; | 663 | radio->intf = intf; |
664 | mutex_init(&radio->disconnect_lock); | ||
665 | mutex_init(&radio->lock); | 664 | mutex_init(&radio->lock); |
666 | 665 | ||
667 | iface_desc = intf->cur_altsetting; | 666 | iface_desc = intf->cur_altsetting; |
@@ -830,7 +829,7 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf) | |||
830 | { | 829 | { |
831 | struct si470x_device *radio = usb_get_intfdata(intf); | 830 | struct si470x_device *radio = usb_get_intfdata(intf); |
832 | 831 | ||
833 | mutex_lock(&radio->disconnect_lock); | 832 | mutex_lock(&radio->lock); |
834 | radio->disconnected = 1; | 833 | radio->disconnected = 1; |
835 | usb_set_intfdata(intf, NULL); | 834 | usb_set_intfdata(intf, NULL); |
836 | if (radio->users == 0) { | 835 | if (radio->users == 0) { |
@@ -843,10 +842,10 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf) | |||
843 | kfree(radio->int_in_buffer); | 842 | kfree(radio->int_in_buffer); |
844 | video_unregister_device(radio->videodev); | 843 | video_unregister_device(radio->videodev); |
845 | kfree(radio->buffer); | 844 | kfree(radio->buffer); |
846 | mutex_unlock(&radio->disconnect_lock); | 845 | mutex_unlock(&radio->lock); |
847 | kfree(radio); | 846 | kfree(radio); |
848 | } else { | 847 | } else { |
849 | mutex_unlock(&radio->disconnect_lock); | 848 | mutex_unlock(&radio->lock); |
850 | } | 849 | } |
851 | } | 850 | } |
852 | 851 | ||