diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 10:35:41 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:20 -0500 |
commit | eda95cbf75193808f62948fb0142ba0901d8bee2 (patch) | |
tree | 047bcfa05bc118b1d34327b3e62fa1d10d4bcb43 /drivers/mtd/chips | |
parent | 329ad399a9b3adf52c90637b21ca029fcf7f8795 (diff) |
mtd: introduce mtd_write interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0020.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c index 666c52f8bf8d..85e80180b65b 100644 --- a/drivers/mtd/chips/cfi_cmdset_0020.c +++ b/drivers/mtd/chips/cfi_cmdset_0020.c | |||
@@ -699,7 +699,8 @@ cfi_staa_writev(struct mtd_info *mtd, const struct kvec *vecs, | |||
699 | continue; | 699 | continue; |
700 | } | 700 | } |
701 | memcpy(buffer+buflen, elem_base, ECCBUF_SIZE-buflen); | 701 | memcpy(buffer+buflen, elem_base, ECCBUF_SIZE-buflen); |
702 | ret = mtd->write(mtd, to, ECCBUF_SIZE, &thislen, buffer); | 702 | ret = mtd_write(mtd, to, ECCBUF_SIZE, &thislen, |
703 | buffer); | ||
703 | totlen += thislen; | 704 | totlen += thislen; |
704 | if (ret || thislen != ECCBUF_SIZE) | 705 | if (ret || thislen != ECCBUF_SIZE) |
705 | goto write_error; | 706 | goto write_error; |
@@ -708,7 +709,8 @@ cfi_staa_writev(struct mtd_info *mtd, const struct kvec *vecs, | |||
708 | to += ECCBUF_SIZE; | 709 | to += ECCBUF_SIZE; |
709 | } | 710 | } |
710 | if (ECCBUF_DIV(elem_len)) { /* write clean aligned data */ | 711 | if (ECCBUF_DIV(elem_len)) { /* write clean aligned data */ |
711 | ret = mtd->write(mtd, to, ECCBUF_DIV(elem_len), &thislen, elem_base); | 712 | ret = mtd_write(mtd, to, ECCBUF_DIV(elem_len), |
713 | &thislen, elem_base); | ||
712 | totlen += thislen; | 714 | totlen += thislen; |
713 | if (ret || thislen != ECCBUF_DIV(elem_len)) | 715 | if (ret || thislen != ECCBUF_DIV(elem_len)) |
714 | goto write_error; | 716 | goto write_error; |
@@ -722,7 +724,7 @@ cfi_staa_writev(struct mtd_info *mtd, const struct kvec *vecs, | |||
722 | } | 724 | } |
723 | if (buflen) { /* flush last page, even if not full */ | 725 | if (buflen) { /* flush last page, even if not full */ |
724 | /* This is sometimes intended behaviour, really */ | 726 | /* This is sometimes intended behaviour, really */ |
725 | ret = mtd->write(mtd, to, buflen, &thislen, buffer); | 727 | ret = mtd_write(mtd, to, buflen, &thislen, buffer); |
726 | totlen += thislen; | 728 | totlen += thislen; |
727 | if (ret || thislen != ECCBUF_SIZE) | 729 | if (ret || thislen != ECCBUF_SIZE) |
728 | goto write_error; | 730 | goto write_error; |