]> err.no Git - linux-2.6/commitdiff
[PATCH] sem2mutex: mtd/doc2000.c
authorIngo Molnar <mingo@elte.hu>
Fri, 31 Mar 2006 10:29:40 +0000 (02:29 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 31 Mar 2006 20:18:48 +0000 (12:18 -0800)
Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/mtd/devices/doc2000.c

index e4345cf744a22d5e927244b4a1fa8e135157a5a9..0f2c956a90d361220155722013d9c1d43ef2e406 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/bitops.h>
+#include <linux/mutex.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
@@ -975,13 +976,13 @@ static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
                          u_char *eccbuf, struct nand_oobinfo *oobsel)
 {
        static char static_buf[512];
-       static DECLARE_MUTEX(writev_buf_sem);
+       static DEFINE_MUTEX(writev_buf_mutex);
 
        size_t totretlen = 0;
        size_t thisvecofs = 0;
        int ret= 0;
 
-       down(&writev_buf_sem);
+       mutex_lock(&writev_buf_mutex);
 
        while(count) {
                size_t thislen, thisretlen;
@@ -1024,7 +1025,7 @@ static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
                to += thislen;
        }
 
-       up(&writev_buf_sem);
+       mutex_unlock(&writev_buf_mutex);
        *retlen = totretlen;
        return ret;
 }