Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efbec1cd authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

tlclk: remove big kernel lock



This driver already has a global mutex, so let's just
use that in the open function instead of the BKL.
It may not even be needed there, but this patch should
have the smallest impact.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: Mark Gross <mark.gross@intel.com>
parent c4a04727
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@
#include <linux/ioport.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/spinlock.h>
#include <linux/smp_lock.h>
#include <linux/mutex.h>
#include <linux/timer.h>
#include <linux/timer.h>
#include <linux/sysfs.h>
#include <linux/sysfs.h>
#include <linux/device.h>
#include <linux/device.h>
@@ -206,7 +206,7 @@ static int tlclk_open(struct inode *inode, struct file *filp)
{
{
	int result;
	int result;


	lock_kernel();
	mutex_lock(&tlclk_mutex);
	if (test_and_set_bit(0, &useflags)) {
	if (test_and_set_bit(0, &useflags)) {
		result = -EBUSY;
		result = -EBUSY;
		/* this legacy device is always one per system and it doesn't
		/* this legacy device is always one per system and it doesn't
@@ -229,7 +229,7 @@ static int tlclk_open(struct inode *inode, struct file *filp)
		inb(TLCLK_REG6);	/* Clear interrupt events */
		inb(TLCLK_REG6);	/* Clear interrupt events */


out:
out:
	unlock_kernel();
	mutex_unlock(&tlclk_mutex);
	return result;
	return result;
}
}