diff options
-rw-r--r-- | drivers/platform/x86/sony-laptop.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index fc0dd63e672..0f710317a94 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
@@ -46,7 +46,6 @@ | |||
46 | #include <linux/module.h> | 46 | #include <linux/module.h> |
47 | #include <linux/moduleparam.h> | 47 | #include <linux/moduleparam.h> |
48 | #include <linux/init.h> | 48 | #include <linux/init.h> |
49 | #include <linux/smp_lock.h> | ||
50 | #include <linux/types.h> | 49 | #include <linux/types.h> |
51 | #include <linux/backlight.h> | 50 | #include <linux/backlight.h> |
52 | #include <linux/platform_device.h> | 51 | #include <linux/platform_device.h> |
@@ -2180,10 +2179,15 @@ static int sonypi_misc_release(struct inode *inode, struct file *file) | |||
2180 | static int sonypi_misc_open(struct inode *inode, struct file *file) | 2179 | static int sonypi_misc_open(struct inode *inode, struct file *file) |
2181 | { | 2180 | { |
2182 | /* Flush input queue on first open */ | 2181 | /* Flush input queue on first open */ |
2183 | lock_kernel(); | 2182 | unsigned long flags; |
2183 | |||
2184 | spin_lock_irqsave(sonypi_compat.fifo->lock, flags); | ||
2185 | |||
2184 | if (atomic_inc_return(&sonypi_compat.open_count) == 1) | 2186 | if (atomic_inc_return(&sonypi_compat.open_count) == 1) |
2185 | kfifo_reset(sonypi_compat.fifo); | 2187 | __kfifo_reset(sonypi_compat.fifo); |
2186 | unlock_kernel(); | 2188 | |
2189 | spin_unlock_irqrestore(sonypi_compat.fifo->lock, flags); | ||
2190 | |||
2187 | return 0; | 2191 | return 0; |
2188 | } | 2192 | } |
2189 | 2193 | ||