From: hauke Date: Wed, 10 Nov 2010 19:02:09 +0000 (+0000) Subject: rtc-rv5c386a: make driver compile with kernel 2.6.36. X-Git-Url: https://git.rohieb.name/openwrt.git/commitdiff_plain/1c8008bc89ebe87ce19b77d008aa84c12d5b2dea rtc-rv5c386a: make driver compile with kernel 2.6.36. This was only compile tested. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23947 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/package/rtc-rv5c386a/src/rtc.c b/package/rtc-rv5c386a/src/rtc.c index 34d0a83aa..5a018102f 100644 --- a/package/rtc-rv5c386a/src/rtc.c +++ b/package/rtc-rv5c386a/src/rtc.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -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 = {