diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-07-15 01:44:51 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-07-15 01:44:51 -0400 |
commit | 43d2548bb2ef7e6d753f91468a746784041e522d (patch) | |
tree | 77d13fcd48fd998393abb825ec36e2b732684a73 /drivers/char/sonypi.c | |
parent | 585583d95c5660973bc0cf64add517b040acd8a4 (diff) | |
parent | 85082fd7cbe3173198aac0eb5e85ab1edcc6352c (diff) |
Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build
Manual fixup of:
arch/powerpc/Kconfig
Diffstat (limited to 'drivers/char/sonypi.c')
-rw-r--r-- | drivers/char/sonypi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 58533de59027..85e0eb76eeab 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/err.h> | 49 | #include <linux/err.h> |
50 | #include <linux/kfifo.h> | 50 | #include <linux/kfifo.h> |
51 | #include <linux/platform_device.h> | 51 | #include <linux/platform_device.h> |
52 | #include <linux/smp_lock.h> | ||
52 | 53 | ||
53 | #include <asm/uaccess.h> | 54 | #include <asm/uaccess.h> |
54 | #include <asm/io.h> | 55 | #include <asm/io.h> |
@@ -906,12 +907,14 @@ static int sonypi_misc_release(struct inode *inode, struct file *file) | |||
906 | 907 | ||
907 | static int sonypi_misc_open(struct inode *inode, struct file *file) | 908 | static int sonypi_misc_open(struct inode *inode, struct file *file) |
908 | { | 909 | { |
910 | lock_kernel(); | ||
909 | mutex_lock(&sonypi_device.lock); | 911 | mutex_lock(&sonypi_device.lock); |
910 | /* Flush input queue on first open */ | 912 | /* Flush input queue on first open */ |
911 | if (!sonypi_device.open_count) | 913 | if (!sonypi_device.open_count) |
912 | kfifo_reset(sonypi_device.fifo); | 914 | kfifo_reset(sonypi_device.fifo); |
913 | sonypi_device.open_count++; | 915 | sonypi_device.open_count++; |
914 | mutex_unlock(&sonypi_device.lock); | 916 | mutex_unlock(&sonypi_device.lock); |
917 | unlock_kernel(); | ||
915 | return 0; | 918 | return 0; |
916 | } | 919 | } |
917 | 920 | ||