Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
[pandora-kernel.git] / arch / cris / arch-v32 / drivers / pcf8563.c
index bef6eb5..b6e4fc0 100644 (file)
@@ -24,7 +24,6 @@
 #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>
@@ -45,6 +44,7 @@
 #define rtc_read(x) i2c_readreg(RTC_I2C_READ, x)
 #define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y)
 
+static DEFINE_MUTEX(pcf8563_mutex);
 static DEFINE_MUTEX(rtc_lock); /* Protect state etc */
 
 static const unsigned char days_in_month[] =
@@ -60,6 +60,7 @@ static int voltage_low;
 static const struct file_operations pcf8563_fops = {
        .owner          = THIS_MODULE,
        .unlocked_ioctl = pcf8563_unlocked_ioctl,
+       .llseek         = noop_llseek,
 };
 
 unsigned char
@@ -339,9 +340,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned
 {
        int ret;
 
-       lock_kernel();
+       mutex_lock(&pcf8563_mutex);
        return pcf8563_ioctl(filp, cmd, arg);
-       unlock_kernel();
+       mutex_unlock(&pcf8563_mutex);
 
        return ret;
 }