MBCS: Convert the semaphore dmawritelock to the mutex API
Signed-off-by: Matthias Kaehlcke <[email protected]>
Index: kernel/linux-2.6/drivers/char/mbcs.h
===================================================================
--- kernel.orig/linux-2.6/drivers/char/mbcs.h 2007-10-23 17:50:50.000000000 +0200
+++ kernel/linux-2.6/drivers/char/mbcs.h 2007-10-24 17:02:12.000000000 +0200
@@ -537,7 +537,7 @@
atomic_t dmawrite_done;
atomic_t dmaread_done;
atomic_t algo_done;
- struct semaphore dmawritelock;
+ struct mutex dmawritelock;
struct semaphore dmareadlock;
struct mutex algolock;
};
Index: kernel/linux-2.6/drivers/char/mbcs.c
===================================================================
--- kernel.orig/linux-2.6/drivers/char/mbcs.c 2007-10-23 17:50:50.000000000 +0200
+++ kernel/linux-2.6/drivers/char/mbcs.c 2007-10-24 17:02:12.000000000 +0200
@@ -311,7 +311,7 @@
{
int rv = 0;
- if (down_interruptible(&soft->dmawritelock))
+ if (mutex_lock_interruptible(&soft->dmawritelock))
return -ERESTARTSYS;
atomic_set(&soft->dmawrite_done, 0);
@@ -337,7 +337,7 @@
*off += len;
dmawrite_exit:
- up(&soft->dmawritelock);
+ mutex_unlock(&soft->dmawritelock);
return rv;
}
@@ -764,7 +764,7 @@
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);
--
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/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]