summaryrefslogtreecommitdiff
path: root/arch/cris/arch-v32/drivers/pcf8563.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-06-01 15:51:25 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2010-06-01 15:51:25 (GMT)
commitb904d7131d116900524bd36ec170dcd97846bfd3 (patch)
treeacd97b3f0027a8dd8659181a316677ee9f578bcc /arch/cris/arch-v32/drivers/pcf8563.c
parent2e8949f09e3097c629f33323eaf280cf5c88c81a (diff)
parent4150764fbba03ce4675b02b10872c665bb05a8aa (diff)
downloadlinux-fsl-qoriq-b904d7131d116900524bd36ec170dcd97846bfd3.tar.xz
Merge branch 'for-linus' of git://www.jni.nu/cris
* 'for-linus' of git://www.jni.nu/cris: CRIS: Don't use mask_irq as symbol name CRIS: Simplify param.h by simply including <asm-generic/param.h> CRISv10: Whitespace fixes for hw_settings.S CRISv10: Trivial fixes. CRISv32: Fix RS485 port 4 CD Kconfig item. CRISv32: Remove duplicated Kconfig items. cris: push down BKL into some device drivers
Diffstat (limited to 'arch/cris/arch-v32/drivers/pcf8563.c')
-rw-r--r--arch/cris/arch-v32/drivers/pcf8563.c21
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) {