summaryrefslogtreecommitdiff
path: root/drivers/staging/cx25821/cx25821-video.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-03-02 20:15:15 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-21 23:32:41 (GMT)
commit0cd301f19a91b3e1fb4130dcd9106777003ed4ed (patch)
tree5c6f30efc843196c15618a78f68cf22049caf8d5 /drivers/staging/cx25821/cx25821-video.c
parentdc46b8c8e3d7e6c7c7ddb78fc2137a5462e98679 (diff)
downloadlinux-fsl-qoriq-0cd301f19a91b3e1fb4130dcd9106777003ed4ed.tar.xz
[media] staging/cx25721: serialize access to devlist
Out of the three files accessing the device list, one uses a mutex, one uses the BKL and one does not have any locking. That is of course pointless, so let's make all of them use the same mutex, and get rid of one more BKL user. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Palash Bandyopadhyay <palash.bandyopadhyay@conexant.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging/cx25821/cx25821-video.c')
-rw-r--r--drivers/staging/cx25821/cx25821-video.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/staging/cx25821/cx25821-video.c b/drivers/staging/cx25821/cx25821-video.c
index 0d8d756..ab05392 100644
--- a/drivers/staging/cx25821/cx25821-video.c
+++ b/drivers/staging/cx25821/cx25821-video.c
@@ -27,7 +27,6 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include "cx25821-video.h"
-#include <linux/smp_lock.h>
MODULE_DESCRIPTION("v4l2 driver module for cx25821 based TV cards");
MODULE_AUTHOR("Hiep Huynh <hiep.huynh@conexant.com>");
@@ -815,7 +814,7 @@ static int video_open(struct file *file)
if (NULL == fh)
return -ENOMEM;
- lock_kernel();
+ mutex_lock(&cx25821_devlist_mutex);
list_for_each(list, &cx25821_devlist)
{
@@ -832,8 +831,8 @@ static int video_open(struct file *file)
}
if (NULL == dev) {
- unlock_kernel();
- return -ENODEV;
+ mutex_unlock(&cx25821_devlist_mutex);
+ return -ENODEV;
}
file->private_data = fh;
@@ -862,7 +861,7 @@ static int video_open(struct file *file)
sizeof(struct cx25821_buffer), fh, NULL);
dprintk(1, "post videobuf_queue_init()\n");
- unlock_kernel();
+ mutex_unlock(&cx25821_devlist_mutex);
return 0;
}