]> err.no Git - linux-2.6/commitdiff
MBCS: convert dmawritelock to mutex
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>
Thu, 7 Feb 2008 08:15:24 +0000 (00:15 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 7 Feb 2008 16:42:25 +0000 (08:42 -0800)
MBCS: Convert the semaphore dmawritelock to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/mbcs.c
drivers/char/mbcs.h

index 035575c041cd87477d5e5e17108443b85220db68..7321c14868af4ba17f7039f25548643a5ef8cce8 100644 (file)
@@ -310,7 +310,7 @@ do_mbcs_sram_dmawrite(struct mbcs_soft *soft, uint64_t hostAddr,
 {
        int rv = 0;
 
-       if (down_interruptible(&soft->dmawritelock))
+       if (mutex_lock_interruptible(&soft->dmawritelock))
                return -ERESTARTSYS;
 
        atomic_set(&soft->dmawrite_done, 0);
@@ -336,7 +336,7 @@ do_mbcs_sram_dmawrite(struct mbcs_soft *soft, uint64_t hostAddr,
        *off += len;
 
 dmawrite_exit:
-       up(&soft->dmawritelock);
+       mutex_unlock(&soft->dmawritelock);
 
        return rv;
 }
@@ -763,7 +763,7 @@ static int mbcs_probe(struct cx_dev *dev, const struct cx_device_id *id)
        init_waitqueue_head(&soft->dmaread_queue);
        init_waitqueue_head(&soft->algo_queue);
 
-       init_MUTEX(&soft->dmawritelock);
+       mutex_init(&soft->dmawritelock);
        init_MUTEX(&soft->dmareadlock);
        mutex_init(&soft->algolock);
 
index d4d97abbce7fa396e172b5d0509f2e06bd269fe1..b05435145d7200c1871ace7f4376f401727d860b 100644 (file)
@@ -537,7 +537,7 @@ struct mbcs_soft {
        atomic_t dmawrite_done;
        atomic_t dmaread_done;
        atomic_t algo_done;
-       struct semaphore dmawritelock;
+       struct mutex dmawritelock;
        struct semaphore dmareadlock;
        struct mutex algolock;
 };