aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/devices/doc2000.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c
index e4345cf744a2..0f2c956a90d3 100644
--- a/drivers/mtd/devices/doc2000.c
+++ b/drivers/mtd/devices/doc2000.c
@@ -20,6 +20,7 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/bitops.h> 22#include <linux/bitops.h>
23#include <linux/mutex.h>
23 24
24#include <linux/mtd/mtd.h> 25#include <linux/mtd/mtd.h>
25#include <linux/mtd/nand.h> 26#include <linux/mtd/nand.h>
@@ -975,13 +976,13 @@ static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
975 u_char *eccbuf, struct nand_oobinfo *oobsel) 976 u_char *eccbuf, struct nand_oobinfo *oobsel)
976{ 977{
977 static char static_buf[512]; 978 static char static_buf[512];
978 static DECLARE_MUTEX(writev_buf_sem); 979 static DEFINE_MUTEX(writev_buf_mutex);
979 980
980 size_t totretlen = 0; 981 size_t totretlen = 0;
981 size_t thisvecofs = 0; 982 size_t thisvecofs = 0;
982 int ret= 0; 983 int ret= 0;
983 984
984 down(&writev_buf_sem); 985 mutex_lock(&writev_buf_mutex);
985 986
986 while(count) { 987 while(count) {
987 size_t thislen, thisretlen; 988 size_t thislen, thisretlen;
@@ -1024,7 +1025,7 @@ static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
1024 to += thislen; 1025 to += thislen;
1025 } 1026 }
1026 1027
1027 up(&writev_buf_sem); 1028 mutex_unlock(&writev_buf_mutex);
1028 *retlen = totretlen; 1029 *retlen = totretlen;
1029 return ret; 1030 return ret;
1030} 1031}