]> err.no Git - linux-2.6/blobdiff - drivers/sbus/char/rtc.c
Merge branch 'core/rodata' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux...
[linux-2.6] / drivers / sbus / char / rtc.c
index 49d1cd99d5accfadf2eb276644f57a8f1ffec27a..b0429917154da55c4f6cfea7abda0366718ac8af 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/smp_lock.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
@@ -19,7 +20,6 @@
 #include <linux/fcntl.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/smp_lock.h>
 #include <asm/io.h>
 #include <asm/mostek.h>
 #include <asm/system.h>
@@ -67,7 +67,7 @@ struct rtc_time_generic {
 /* Retrieve the current date and time from the real time clock. */
 static void get_rtc_time(struct rtc_time *t)
 {
-       void * __iomem regs = mstk48t02_regs;
+       void __iomem *regs = mstk48t02_regs;
        u8 tmp;
 
        spin_lock_irq(&mostek_lock);
@@ -94,7 +94,7 @@ static void get_rtc_time(struct rtc_time *t)
 /* Set the current date and time inthe real time clock. */
 void set_rtc_time(struct rtc_time *t)
 {
-       void * __iomem regs = mstk48t02_regs;
+       void __iomem *regs = mstk48t02_regs;
        u8 tmp;
 
        spin_lock_irq(&mostek_lock);
@@ -214,6 +214,7 @@ static int rtc_open(struct inode *inode, struct file *file)
 {
        int ret;
 
+       lock_kernel();
        spin_lock_irq(&mostek_lock);
        if (rtc_busy) {
                ret = -EBUSY;
@@ -222,6 +223,7 @@ static int rtc_open(struct inode *inode, struct file *file)
                ret = 0;
        }
        spin_unlock_irq(&mostek_lock);
+       unlock_kernel();
 
        return ret;
 }
@@ -233,7 +235,7 @@ static int rtc_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations rtc_fops = {
+static const struct file_operations rtc_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .ioctl =        rtc_ioctl,
@@ -250,7 +252,7 @@ static int __init rtc_sun_init(void)
        /* It is possible we are being driven by some other RTC chip
         * and thus another RTC driver is handling things.
         */
-       if (mstk48t02_regs == 0)
+       if (!mstk48t02_regs)
                return -ENODEV;
 
        error = misc_register(&rtc_dev);