|
@@ -49,6 +49,7 @@
|
|
|
#include <linux/err.h>
|
|
|
#include <linux/kfifo.h>
|
|
|
#include <linux/platform_device.h>
|
|
|
+#include <linux/smp_lock.h>
|
|
|
|
|
|
#include <asm/uaccess.h>
|
|
|
#include <asm/io.h>
|
|
@@ -906,12 +907,14 @@ static int sonypi_misc_release(struct inode *inode, struct file *file)
|
|
|
|
|
|
static int sonypi_misc_open(struct inode *inode, struct file *file)
|
|
|
{
|
|
|
+ lock_kernel();
|
|
|
mutex_lock(&sonypi_device.lock);
|
|
|
/* Flush input queue on first open */
|
|
|
if (!sonypi_device.open_count)
|
|
|
kfifo_reset(sonypi_device.fifo);
|
|
|
sonypi_device.open_count++;
|
|
|
mutex_unlock(&sonypi_device.lock);
|
|
|
+ unlock_kernel();
|
|
|
return 0;
|
|
|
}
|
|
|
|