aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/doc2000.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c
index 423a34f4638c..6f32942fdf77 100644
--- a/drivers/mtd/devices/doc2000.c
+++ b/drivers/mtd/devices/doc2000.c
@@ -59,9 +59,6 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
59 size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); 59 size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
60static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, 60static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
61 size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); 61 size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
62static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
63 unsigned long count, loff_t to, size_t *retlen,
64 u_char *eccbuf, struct nand_oobinfo *oobsel);
65static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len, 62static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
66 size_t *retlen, u_char *buf); 63 size_t *retlen, u_char *buf);
67static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len, 64static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
@@ -589,7 +586,6 @@ void DoC2k_init(struct mtd_info *mtd)
589 mtd->write = doc_write; 586 mtd->write = doc_write;
590 mtd->read_ecc = doc_read_ecc; 587 mtd->read_ecc = doc_read_ecc;
591 mtd->write_ecc = doc_write_ecc; 588 mtd->write_ecc = doc_write_ecc;
592 mtd->writev_ecc = doc_writev_ecc;
593 mtd->read_oob = doc_read_oob; 589 mtd->read_oob = doc_read_oob;
594 mtd->write_oob = doc_write_oob; 590 mtd->write_oob = doc_write_oob;
595 mtd->sync = NULL; 591 mtd->sync = NULL;
@@ -965,66 +961,6 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
965 return 0; 961 return 0;
966} 962}
967 963
968static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
969 unsigned long count, loff_t to, size_t *retlen,
970 u_char *eccbuf, struct nand_oobinfo *oobsel)
971{
972 static char static_buf[512];
973 static DEFINE_MUTEX(writev_buf_mutex);
974
975 size_t totretlen = 0;
976 size_t thisvecofs = 0;
977 int ret= 0;
978
979 mutex_lock(&writev_buf_mutex);
980
981 while(count) {
982 size_t thislen, thisretlen;
983 unsigned char *buf;
984
985 buf = vecs->iov_base + thisvecofs;
986 thislen = vecs->iov_len - thisvecofs;
987
988
989 if (thislen >= 512) {
990 thislen = thislen & ~(512-1);
991 thisvecofs += thislen;
992 } else {
993 /* Not enough to fill a page. Copy into buf */
994 memcpy(static_buf, buf, thislen);
995 buf = &static_buf[thislen];
996
997 while(count && thislen < 512) {
998 vecs++;
999 count--;
1000 thisvecofs = min((512-thislen), vecs->iov_len);
1001 memcpy(buf, vecs->iov_base, thisvecofs);
1002 thislen += thisvecofs;
1003 buf += thisvecofs;
1004 }
1005 buf = static_buf;
1006 }
1007 if (count && thisvecofs == vecs->iov_len) {
1008 thisvecofs = 0;
1009 vecs++;
1010 count--;
1011 }
1012 ret = doc_write_ecc(mtd, to, thislen, &thisretlen, buf, eccbuf, oobsel);
1013
1014 totretlen += thisretlen;
1015
1016 if (ret || thisretlen != thislen)
1017 break;
1018
1019 to += thislen;
1020 }
1021
1022 mutex_unlock(&writev_buf_mutex);
1023 *retlen = totretlen;
1024 return ret;
1025}
1026
1027
1028static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len, 964static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
1029 size_t * retlen, u_char * buf) 965 size_t * retlen, u_char * buf)
1030{ 966{