]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/char/pcmcia/cm4040_cs.c
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
[karo-tx-linux.git] / drivers / char / pcmcia / cm4040_cs.c
index bf2f046fc2c122d6464dcd4c407433be9c83aa20..5d8d59e865f4b15cea3194ec8ef23c8f5d07c736 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/fs.h>
 #include <linux/delay.h>
 #include <linux/poll.h>
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
 #include <linux/wait.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -48,6 +48,8 @@
                           __func__ , ## args);         \
        } while (0)
 
+static DEFINE_MUTEX(cm4040_mutex);
+
 #define        CCID_DRIVER_BULK_DEFAULT_TIMEOUT        (150*HZ)
 #define        CCID_DRIVER_ASYNC_POWERUP_TIMEOUT       (35*HZ)
 #define        CCID_DRIVER_MINIMUM_TIMEOUT             (3*HZ)
@@ -440,7 +442,7 @@ static int cm4040_open(struct inode *inode, struct file *filp)
        if (minor >= CM_MAX_DEV)
                return -ENODEV;
 
-       lock_kernel();
+       mutex_lock(&cm4040_mutex);
        link = dev_table[minor];
        if (link == NULL || !pcmcia_dev_present(link)) {
                ret = -ENODEV;
@@ -469,7 +471,7 @@ static int cm4040_open(struct inode *inode, struct file *filp)
        DEBUGP(2, dev, "<- cm4040_open (successfully)\n");
        ret = nonseekable_open(inode, filp);
 out:
-       unlock_kernel();
+       mutex_unlock(&cm4040_mutex);
        return ret;
 }
 
@@ -628,6 +630,7 @@ static const struct file_operations reader_fops = {
        .open           = cm4040_open,
        .release        = cm4040_close,
        .poll           = cm4040_poll,
+       .llseek         = no_llseek,
 };
 
 static struct pcmcia_device_id cm4040_ids[] = {