aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-09-14 15:35:06 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:06:12 -0400
commit104a698657148e130ad22c8fc245e9bac317c7c5 (patch)
treebe7bcb513d8abd79a7f36d99963c0c51b0312b15
parente4e62b35b8cf008f47ffd240d04bde654d289a46 (diff)
V4L/DVB: dvb/bt8xx: kill the big kernel lock
The bt8xx driver only uses the big kernel lock in its dst_ca_ioctl function and never to serialize against other code, so we can trivially replace it with a private mutex. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/bt8xx/dst_ca.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c
index cf8705162845..d75788b4e22e 100644
--- a/drivers/media/dvb/bt8xx/dst_ca.c
+++ b/drivers/media/dvb/bt8xx/dst_ca.c
@@ -22,7 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/smp_lock.h> 25#include <linux/mutex.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/dvb/ca.h> 27#include <linux/dvb/ca.h>
28#include "dvbdev.h" 28#include "dvbdev.h"
@@ -52,6 +52,7 @@
52} while(0) 52} while(0)
53 53
54 54
55static DEFINE_MUTEX(dst_ca_mutex);
55static unsigned int verbose = 5; 56static unsigned int verbose = 5;
56module_param(verbose, int, 0644); 57module_param(verbose, int, 0644);
57MODULE_PARM_DESC(verbose, "verbose startup messages, default is 1 (yes)"); 58MODULE_PARM_DESC(verbose, "verbose startup messages, default is 1 (yes)");
@@ -564,7 +565,7 @@ static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioct
564 void __user *arg = (void __user *)ioctl_arg; 565 void __user *arg = (void __user *)ioctl_arg;
565 int result = 0; 566 int result = 0;
566 567
567 lock_kernel(); 568 mutex_lock(&dst_ca_mutex);
568 dvbdev = file->private_data; 569 dvbdev = file->private_data;
569 state = (struct dst_state *)dvbdev->priv; 570 state = (struct dst_state *)dvbdev->priv;
570 p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL); 571 p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL);
@@ -652,7 +653,7 @@ static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioct
652 kfree (p_ca_slot_info); 653 kfree (p_ca_slot_info);
653 kfree (p_ca_caps); 654 kfree (p_ca_caps);
654 655
655 unlock_kernel(); 656 mutex_unlock(&dst_ca_mutex);
656 return result; 657 return result;
657} 658}
658 659