MBCS: Convert the semaphore dmareadlock to the mutex API

Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
--- kernel.orig/linux-2.6/drivers/char/mbcs.c   2007-10-23 17:43:36.000000000 
+0200
+++ kernel/linux-2.6/drivers/char/mbcs.c        2007-10-23 17:44:11.000000000 
+0200
@@ -348,7 +348,7 @@
 {
        int rv = 0;
 
-       if (down_interruptible(&soft->dmareadlock))
+       if (mutex_lock_interruptible(&soft->dmareadlock))
                return -ERESTARTSYS;
 
        atomic_set(&soft->dmawrite_done, 0);
@@ -373,7 +373,7 @@
        *off += len;
 
 dmaread_exit:
-       up(&soft->dmareadlock);
+       mutex_unlock(&soft->dmareadlock);
 
        return rv;
 }
@@ -765,7 +765,7 @@
        init_waitqueue_head(&soft->algo_queue);
 
        mutex_init(&soft->dmawritelock);
-       init_MUTEX(&soft->dmareadlock);
+       mutex_init(&soft->dmareadlock);
        mutex_init(&soft->algolock);
 
        mbcs_getdma_init(&soft->getdma);
Index: kernel/linux-2.6/drivers/char/mbcs.h
===================================================================
--- kernel.orig/linux-2.6/drivers/char/mbcs.h   2007-10-23 17:43:38.000000000 
+0200
+++ kernel/linux-2.6/drivers/char/mbcs.h        2007-10-23 17:44:33.000000000 
+0200
@@ -538,7 +538,7 @@
        atomic_t dmaread_done;
        atomic_t algo_done;
        struct mutex dmawritelock;
-       struct semaphore dmareadlock;
+       struct mutex dmareadlock;
        struct mutex algolock;
 };
 

-- 
Matthias Kaehlcke
Linux Application Developer
Barcelona

              We build too many walls and not enough bridges
                             (Isaac Newton)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to