diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-04-27 16:24:21 +0200 |
---|---|---|
committer | Jesper Nilsson <jesper.nilsson@axis.com> | 2010-04-29 16:36:40 +0200 |
commit | f35d77645808d1b890abb1a36260bf228854259e (patch) | |
tree | 6453ad50414f3e09c6a62ca1bacab0353bbdf551 /arch/cris/arch-v32/drivers/pcf8563.c | |
parent | 1d16b0f2f3edf05f12a9e3960588e0d4854157bb (diff) | |
download | op-kernel-dev-f35d77645808d1b890abb1a36260bf228854259e.zip op-kernel-dev-f35d77645808d1b890abb1a36260bf228854259e.tar.gz |
cris: push down BKL into some device drivers
A number of cris specific device drivers still use the
locked ->ioctl operation. Convert them to unlocked_ioctl
with explicit lock_kernel calls.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Diffstat (limited to 'arch/cris/arch-v32/drivers/pcf8563.c')
-rw-r--r-- | arch/cris/arch-v32/drivers/pcf8563.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c index f447850..bef6eb5 100644 --- a/arch/cris/arch-v32/drivers/pcf8563.c +++ b/arch/cris/arch-v32/drivers/pcf8563.c @@ -24,6 +24,7 @@ #include <linux/init.h> #include <linux/fs.h> #include <linux/ioctl.h> +#include <linux/smp_lock.h> #include <linux/delay.h> #include <linux/bcd.h> #include <linux/mutex.h> @@ -49,7 +50,7 @@ static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ static const unsigned char days_in_month[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; -int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); +static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); /* Cache VL bit value read at driver init since writing the RTC_SECOND * register clears the VL status. @@ -57,8 +58,8 @@ int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); static int voltage_low; static const struct file_operations pcf8563_fops = { - .owner = THIS_MODULE, - .ioctl = pcf8563_ioctl + .owner = THIS_MODULE, + .unlocked_ioctl = pcf8563_unlocked_ioctl, }; unsigned char @@ -208,8 +209,7 @@ pcf8563_exit(void) * ioctl calls for this driver. Why return -ENOTTY upon error? Because * POSIX says so! */ -int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, - unsigned long arg) +static int pcf8563_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { /* Some sanity checks. */ if (_IOC_TYPE(cmd) != RTC_MAGIC) @@ -335,6 +335,17 @@ int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, return 0; } +static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) +{ + int ret; + + lock_kernel(); + return pcf8563_ioctl(filp, cmd, arg); + unlock_kernel(); + + return ret; +} + static int __init pcf8563_register(void) { if (pcf8563_init() < 0) { |