diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-09-11 18:18:22 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2010-09-26 16:25:55 +0200 |
commit | 0890b5880df6a4989336add11f3a22122b26d9e1 (patch) | |
tree | f35644d8e6730b72aeedb61a654a2d06e5610244 /arch/cris/arch-v10/drivers/ds1302.c | |
parent | 80eb4a6f89bbf8e8318e108701bad11451efb2df (diff) |
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/ds1302.c')
-rw-r--r-- | arch/cris/arch-v10/drivers/ds1302.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c index 884275629ef..4b92ad08b0f 100644 --- a/arch/cris/arch-v10/drivers/ds1302.c +++ b/arch/cris/arch-v10/drivers/ds1302.c @@ -19,7 +19,7 @@ #include <linux/module.h> #include <linux/miscdevice.h> #include <linux/delay.h> -#include <linux/smp_lock.h> +#include <linux/mutex.h> #include <linux/bcd.h> #include <linux/capability.h> @@ -34,6 +34,7 @@ #define RTC_MAJOR_NR 121 /* local major, change later */ +static DEFINE_MUTEX(ds1302_mutex); static const char ds1302_name[] = "ds1302"; /* The DS1302 might be connected to different bits on different products. @@ -357,9 +358,9 @@ static long rtc_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned lon { int ret; - lock_kernel(); + mutex_lock(&ds1302_mutex); ret = rtc_ioctl(file, cmd, arg); - unlock_kernel(); + mutex_unlock(&ds1302_mutex); return ret; } |