Skip to content

Commit 040d79f

Browse files
Ingo MolnarLinus Torvalds
authored andcommitted
[PATCH] sem2mutex: mtd/doc2000.c
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>
1 parent 37466ea commit 040d79f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/mtd/devices/doc2000.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/init.h>
2121
#include <linux/types.h>
2222
#include <linux/bitops.h>
23+
#include <linux/mutex.h>
2324

2425
#include <linux/mtd/mtd.h>
2526
#include <linux/mtd/nand.h>
@@ -975,13 +976,13 @@ static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
975976
u_char *eccbuf, struct nand_oobinfo *oobsel)
976977
{
977978
static char static_buf[512];
978-
static DECLARE_MUTEX(writev_buf_sem);
979+
static DEFINE_MUTEX(writev_buf_mutex);
979980

980981
size_t totretlen = 0;
981982
size_t thisvecofs = 0;
982983
int ret= 0;
983984

984-
down(&writev_buf_sem);
985+
mutex_lock(&writev_buf_mutex);
985986

986987
while(count) {
987988
size_t thislen, thisretlen;
@@ -1024,7 +1025,7 @@ static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
10241025
to += thislen;
10251026
}
10261027

1027-
up(&writev_buf_sem);
1028+
mutex_unlock(&writev_buf_mutex);
10281029
*retlen = totretlen;
10291030
return ret;
10301031
}

0 commit comments

Comments
 (0)