Skip to contentSkip to conversation

staging: cx25821: Reuse the mutex lock for remove BKL

PATCH New Alessio Igor Bogani 1 participant 1 message Mar 23, 2011 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: cx25821: Reuse the mutex lock for remove BKL

The BKL isn't exit anymore so this driver don't should use it.

Build tested only.

---
 drivers/staging/cx25821/Kconfig         |    1 -
 drivers/staging/cx25821/cx25821-video.c |    8 ++++----
 drivers/staging/cx25821/cx25821.h       |    1 -
 3 files changed, 4 insertions(+), 6 deletions(-)
drivers/staging/cx25821/Kconfig +0 -1
index b265695..5f6b542 100644
@@ -1,7 +1,6 @@
 config VIDEO_CX25821
 	tristate "Conexant cx25821 support"
 	depends on DVB_CORE && VIDEO_DEV && PCI && I2C
-	depends on BKL # please fix
 	select I2C_ALGOBIT
 	select VIDEO_BTCX
 	select VIDEO_TVEEPROM
drivers/staging/cx25821/cx25821-video.c +4 -4
index 0d8d756..9dbe551 100644
@@ -27,7 +27,7 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include "cx25821-video.h"
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
 
 MODULE_DESCRIPTION("v4l2 driver module for cx25821 based TV cards");
 MODULE_AUTHOR("Hiep Huynh <[email protected]>");
@@ -815,7 +815,7 @@ static int video_open(struct file *file)
        if (NULL == fh)
 	       return -ENOMEM;
 
-       lock_kernel();
+       mutex_lock(&h->lock);
 
        list_for_each(list, &cx25821_devlist)
        {
@@ -832,7 +832,7 @@ static int video_open(struct file *file)
        }
 
        if (NULL == dev) {
-	       unlock_kernel();
+	       mutex_unlock(&h->lock);
 	       return -ENODEV;
        }
 
@@ -862,7 +862,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(&h->lock);
 
        return 0;
 }
drivers/staging/cx25821/cx25821.h +0 -1
index 5511523..8417a73 100644
@@ -31,7 +31,6 @@
 #include <linux/delay.h>
 #include <linux/sched.h>
 #include <linux/kdev_t.h>
-#include <linux/smp_lock.h>
 
 #include <media/v4l2-common.h>
 #include <media/v4l2-device.h>
Signature · 1 line
1.7.0.4