summaryrefslogtreecommitdiff
path: root/package/rtc-rv5c386a
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2010-11-10 19:02:09 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2010-11-10 19:02:09 +0000
commitb31890cdcf00ea7d5cb394e017b6012ac184a476 (patch)
treea02588829d18e8c993060d09dc4f6ed3a2e5b112 /package/rtc-rv5c386a
parentb10aea0075a06e44378454c3ddb8dd4031b95150 (diff)
downloadmtk-20170518-b31890cdcf00ea7d5cb394e017b6012ac184a476.zip
mtk-20170518-b31890cdcf00ea7d5cb394e017b6012ac184a476.tar.gz
mtk-20170518-b31890cdcf00ea7d5cb394e017b6012ac184a476.tar.bz2
rtc-rv5c386a: make driver compile with kernel 2.6.36.
This was only compile tested. SVN-Revision: 23947
Diffstat (limited to 'package/rtc-rv5c386a')
-rw-r--r--package/rtc-rv5c386a/src/rtc.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/package/rtc-rv5c386a/src/rtc.c b/package/rtc-rv5c386a/src/rtc.c
index 34d0a83..5a01810 100644
--- a/package/rtc-rv5c386a/src/rtc.c
+++ b/package/rtc-rv5c386a/src/rtc.c
@@ -52,6 +52,7 @@
#include <linux/rtc.h>
#include <linux/delay.h>
#include <linux/version.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -461,8 +462,7 @@ static ssize_t rtc_read(UNUSED struct file *filp, char *buf, size_t count,
return len;
}
-static int rtc_ioctl(UNUSED struct inode *inode, UNUSED struct file *filp,
- unsigned int cmd, unsigned long arg)
+static int rtc_do_ioctl(unsigned int cmd, unsigned long arg)
{
struct rtc_time rtc_tm;
@@ -492,14 +492,23 @@ static int rtc_ioctl(UNUSED struct inode *inode, UNUSED struct file *filp,
return 0;
}
-static struct file_operations rtc_fops = {
- .owner = THIS_MODULE,
- .llseek = no_llseek,
- .read = rtc_read,
- .write = rtc_write,
- .ioctl = rtc_ioctl,
- .open = rtc_open,
- .release = rtc_release,
+static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+ long ret;
+ lock_kernel();
+ ret = rtc_do_ioctl(cmd, arg);
+ unlock_kernel();
+ return ret;
+}
+
+static const struct file_operations rtc_fops = {
+ .owner = THIS_MODULE,
+ .llseek = no_llseek,
+ .read = rtc_read,
+ .write = rtc_write,
+ .unlocked_ioctl = rtc_ioctl,
+ .open = rtc_open,
+ .release = rtc_release,
};
static struct miscdevice rtc_dev = {