sony-laptop: Kill the BKL
authorAlessio Igor Bogani <abogani@texware.it>
Thu, 26 Mar 2009 12:58:25 +0000 (21:58 +0900)
committerLen Brown <len.brown@intel.com>
Fri, 27 Mar 2009 16:20:45 +0000 (12:20 -0400)
Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/platform/x86/sony-laptop.c

index fc0dd63e672d640e479c953588e9230c09b3bcbf..0f710317a94ec3f61c9a73777265c4be848e3b8e 100644 (file)
@@ -46,7 +46,6 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
-#include <linux/smp_lock.h>
 #include <linux/types.h>
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
@@ -2180,10 +2179,15 @@ static int sonypi_misc_release(struct inode *inode, struct file *file)
 static int sonypi_misc_open(struct inode *inode, struct file *file)
 {
        /* Flush input queue on first open */
-       lock_kernel();
+       unsigned long flags;
+
+       spin_lock_irqsave(sonypi_compat.fifo->lock, flags);
+
        if (atomic_inc_return(&sonypi_compat.open_count) == 1)
-               kfifo_reset(sonypi_compat.fifo);
-       unlock_kernel();
+               __kfifo_reset(sonypi_compat.fifo);
+
+       spin_unlock_irqrestore(sonypi_compat.fifo->lock, flags);
+
        return 0;
 }