From: Alessio Igor Bogani Date: Thu, 26 Mar 2009 12:58:25 +0000 (+0900) Subject: sony-laptop: Kill the BKL X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4ef4cbb3686f9265da87bc6e482162c96f415427;p=linux-beck.git sony-laptop: Kill the BKL Signed-off-by: Alessio Igor Bogani Signed-off-by: Mattia Dongili Signed-off-by: Len Brown --- diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index fc0dd63e672d..0f710317a94e 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -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; }