aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/doc2000.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-03-31 05:29:41 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-31 15:18:48 -0500
commit48b192686dd20cb1576ae1d8ccd17a07971ef24a (patch)
treea4e5f5a74c230439fdbdc895f7874c68bf505565 /drivers/mtd/devices/doc2000.c
parent040d79f906654d55c810313f29c6605593bf21c5 (diff)
[PATCH] sem2mutex: drivers/mtd/
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>
Diffstat (limited to 'drivers/mtd/devices/doc2000.c')
-rw-r--r--drivers/mtd/devices/doc2000.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c
index 0f2c956a90d3..23e7a5c7d2c1 100644
--- a/drivers/mtd/devices/doc2000.c
+++ b/drivers/mtd/devices/doc2000.c
@@ -606,7 +606,7 @@ static void DoC2k_init(struct mtd_info *mtd)
606 606
607 this->curfloor = -1; 607 this->curfloor = -1;
608 this->curchip = -1; 608 this->curchip = -1;
609 init_MUTEX(&this->lock); 609 mutex_init(&this->lock);
610 610
611 /* Ident all the chips present. */ 611 /* Ident all the chips present. */
612 DoC_ScanChips(this, maxchips); 612 DoC_ScanChips(this, maxchips);
@@ -646,7 +646,7 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
646 if (from >= this->totlen) 646 if (from >= this->totlen)
647 return -EINVAL; 647 return -EINVAL;
648 648
649 down(&this->lock); 649 mutex_lock(&this->lock);
650 650
651 *retlen = 0; 651 *retlen = 0;
652 while (left) { 652 while (left) {
@@ -775,7 +775,7 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
775 buf += len; 775 buf += len;
776 } 776 }
777 777
778 up(&this->lock); 778 mutex_unlock(&this->lock);
779 779
780 return ret; 780 return ret;
781} 781}
@@ -804,7 +804,7 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
804 if (to >= this->totlen) 804 if (to >= this->totlen)
805 return -EINVAL; 805 return -EINVAL;
806 806
807 down(&this->lock); 807 mutex_lock(&this->lock);
808 808
809 *retlen = 0; 809 *retlen = 0;
810 while (left) { 810 while (left) {
@@ -874,7 +874,7 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
874 printk(KERN_ERR "Error programming flash\n"); 874 printk(KERN_ERR "Error programming flash\n");
875 /* Error in programming */ 875 /* Error in programming */
876 *retlen = 0; 876 *retlen = 0;
877 up(&this->lock); 877 mutex_unlock(&this->lock);
878 return -EIO; 878 return -EIO;
879 } 879 }
880 880
@@ -936,7 +936,7 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
936 printk(KERN_ERR "Error programming flash\n"); 936 printk(KERN_ERR "Error programming flash\n");
937 /* Error in programming */ 937 /* Error in programming */
938 *retlen = 0; 938 *retlen = 0;
939 up(&this->lock); 939 mutex_unlock(&this->lock);
940 return -EIO; 940 return -EIO;
941 } 941 }
942 942
@@ -957,7 +957,7 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
957 957
958 ret = doc_write_oob_nolock(mtd, to, 8, &dummy, x); 958 ret = doc_write_oob_nolock(mtd, to, 8, &dummy, x);
959 if (ret) { 959 if (ret) {
960 up(&this->lock); 960 mutex_unlock(&this->lock);
961 return ret; 961 return ret;
962 } 962 }
963 } 963 }
@@ -967,7 +967,7 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
967 buf += len; 967 buf += len;
968 } 968 }
969 969
970 up(&this->lock); 970 mutex_unlock(&this->lock);
971 return 0; 971 return 0;
972} 972}
973 973
@@ -1038,7 +1038,7 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
1038 int len256 = 0, ret; 1038 int len256 = 0, ret;
1039 struct Nand *mychip; 1039 struct Nand *mychip;
1040 1040
1041 down(&this->lock); 1041 mutex_lock(&this->lock);
1042 1042
1043 mychip = &this->chips[ofs >> this->chipshift]; 1043 mychip = &this->chips[ofs >> this->chipshift];
1044 1044
@@ -1084,7 +1084,7 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
1084 1084
1085 ret = DoC_WaitReady(this); 1085 ret = DoC_WaitReady(this);
1086 1086
1087 up(&this->lock); 1087 mutex_unlock(&this->lock);
1088 return ret; 1088 return ret;
1089 1089
1090} 1090}
@@ -1198,10 +1198,10 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
1198 struct DiskOnChip *this = mtd->priv; 1198 struct DiskOnChip *this = mtd->priv;
1199 int ret; 1199 int ret;
1200 1200
1201 down(&this->lock); 1201 mutex_lock(&this->lock);
1202 ret = doc_write_oob_nolock(mtd, ofs, len, retlen, buf); 1202 ret = doc_write_oob_nolock(mtd, ofs, len, retlen, buf);
1203 1203
1204 up(&this->lock); 1204 mutex_unlock(&this->lock);
1205 return ret; 1205 return ret;
1206} 1206}
1207 1207
@@ -1215,10 +1215,10 @@ static int doc_erase(struct mtd_info *mtd, struct erase_info *instr)
1215 struct Nand *mychip; 1215 struct Nand *mychip;
1216 int status; 1216 int status;
1217 1217
1218 down(&this->lock); 1218 mutex_lock(&this->lock);
1219 1219
1220 if (ofs & (mtd->erasesize-1) || len & (mtd->erasesize-1)) { 1220 if (ofs & (mtd->erasesize-1) || len & (mtd->erasesize-1)) {
1221 up(&this->lock); 1221 mutex_unlock(&this->lock);
1222 return -EINVAL; 1222 return -EINVAL;
1223 } 1223 }
1224 1224
@@ -1266,7 +1266,7 @@ static int doc_erase(struct mtd_info *mtd, struct erase_info *instr)
1266 callback: 1266 callback:
1267 mtd_erase_callback(instr); 1267 mtd_erase_callback(instr);
1268 1268
1269 up(&this->lock); 1269 mutex_unlock(&this->lock);
1270 return 0; 1270 return 0;
1271} 1271}
1272 1272