Merge branch 'for-linus' of git://gitorious.org/linux-omap-dss2/linux
[pandora-kernel.git] / arch / cris / arch-v10 / drivers / sync_serial.c
index ee2dd43..399dc1e 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/interrupt.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
 #include <linux/timer.h>
 #include <asm/irq.h>
 #include <asm/dma.h>
@@ -149,6 +149,7 @@ struct sync_port {
 };
 
 
+static DEFINE_MUTEX(sync_serial_mutex);
 static int etrax_sync_serial_init(void);
 static void initialize_port(int portnbr);
 static inline int sync_data_avail(struct sync_port *port);
@@ -250,7 +251,8 @@ static const struct file_operations sync_serial_fops = {
        .poll           = sync_serial_poll,
        .unlocked_ioctl = sync_serial_ioctl,
        .open           = sync_serial_open,
-       .release        = sync_serial_release
+       .release        = sync_serial_release,
+       .llseek         = noop_llseek,
 };
 
 static int __init etrax_sync_serial_init(void)
@@ -445,7 +447,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
        int mode;
        int err = -EBUSY;
 
-       lock_kernel();
+       mutex_lock(&sync_serial_mutex);
        DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev));
 
        if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) {
@@ -626,7 +628,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
        ret = 0;
        
 out:
-       unlock_kernel();
+       mutex_unlock(&sync_serial_mutex);
        return ret;
 }
 
@@ -961,9 +963,9 @@ static long sync_serial_ioctl(struct file *file,
 {
        long ret;
 
-       lock_kernel();
+       mutex_lock(&sync_serial_mutex);
        ret = sync_serial_ioctl_unlocked(file, cmd, arg);
-       unlock_kernel();
+       mutex_unlock(&sync_serial_mutex);
 
        return ret;
 }