Skip to content

Commit

Permalink
sonypi: BKL pushdown
Browse files Browse the repository at this point in the history
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann authored and Jonathan Corbet committed Jul 2, 2008
1 parent 0410e68 commit f8f2c79
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/char/sonypi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit f8f2c79

Please sign in to comment.