summaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v10/drivers/pcf8563.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-09-11 18:18:22 +0200
committerArnd Bergmann <arnd@arndb.de>2010-09-26 16:25:55 +0200
commit0890b5880df6a4989336add11f3a22122b26d9e1 (patch)
treef35644d8e6730b72aeedb61a654a2d06e5610244 /arch/cris/arch-v10/drivers/pcf8563.c
parent80eb4a6f89bbf8e8318e108701bad11451efb2df (diff)
downloadtalos-obmc-linux-0890b5880df6a4989336add11f3a22122b26d9e1.tar.gz
talos-obmc-linux-0890b5880df6a4989336add11f3a22122b26d9e1.zip
cris: autoconvert trivial BKL users
All uses of the big kernel lock in the cris architecture are for ioctl and open functions of character device drivers, which can be trivially converted to a per-driver mutex. Most of these are probably unnecessary, so it may make sense to audit them and eventually remove the extra mutex introduced by this patch. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Mikael Starvik <starvik@axis.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Cc: linux-cris-kernel@axis.com
Diffstat (limited to 'arch/cris/arch-v10/drivers/pcf8563.c')
-rw-r--r--arch/cris/arch-v10/drivers/pcf8563.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c
index 7dcb1f85f42b..2f1ddedca2bd 100644
--- a/arch/cris/arch-v10/drivers/pcf8563.c
+++ b/arch/cris/arch-v10/drivers/pcf8563.c
@@ -27,7 +27,6 @@
#include <linux/delay.h>
#include <linux/bcd.h>
#include <linux/mutex.h>
-#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -49,6 +48,7 @@
#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x)
#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y)
+static DEFINE_MUTEX(pcf8563_mutex);
static DEFINE_MUTEX(rtc_lock); /* Protect state etc */
static const unsigned char days_in_month[] =
@@ -343,9 +343,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned
{
int ret;
- lock_kernel();
+ mutex_lock(&pcf8563_mutex);
return pcf8563_ioctl(filp, cmd, arg);
- unlock_kernel();
+ mutex_unlock(&pcf8563_mutex);
return ret;
}
OpenPOWER on IntegriCloud