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/ubi/io.c | |
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/ubi/io.c')
-rw-r--r-- | drivers/mtd/ubi/io.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 433382951d3d..8d832fc9e9e4 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c | |||
@@ -289,7 +289,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset, | |||
289 | } | 289 | } |
290 | 290 | ||
291 | addr = (loff_t)pnum * ubi->peb_size + offset; | 291 | addr = (loff_t)pnum * ubi->peb_size + offset; |
292 | err = ubi->mtd->write(ubi->mtd, addr, len, &written, buf); | 292 | err = mtd_write(ubi->mtd, addr, len, &written, buf); |
293 | if (err) { | 293 | if (err) { |
294 | ubi_err("error %d while writing %d bytes to PEB %d:%d, written " | 294 | ubi_err("error %d while writing %d bytes to PEB %d:%d, written " |
295 | "%zd bytes", err, len, pnum, offset, written); | 295 | "%zd bytes", err, len, pnum, offset, written); |
@@ -525,11 +525,10 @@ static int nor_erase_prepare(struct ubi_device *ubi, int pnum) | |||
525 | * the header comment in scan.c for more information). | 525 | * the header comment in scan.c for more information). |
526 | */ | 526 | */ |
527 | addr = (loff_t)pnum * ubi->peb_size; | 527 | addr = (loff_t)pnum * ubi->peb_size; |
528 | err = ubi->mtd->write(ubi->mtd, addr, 4, &written, (void *)&data); | 528 | err = mtd_write(ubi->mtd, addr, 4, &written, (void *)&data); |
529 | if (!err) { | 529 | if (!err) { |
530 | addr += ubi->vid_hdr_aloffset; | 530 | addr += ubi->vid_hdr_aloffset; |
531 | err = ubi->mtd->write(ubi->mtd, addr, 4, &written, | 531 | err = mtd_write(ubi->mtd, addr, 4, &written, (void *)&data); |
532 | (void *)&data); | ||
533 | if (!err) | 532 | if (!err) |
534 | return 0; | 533 | return 0; |
535 | } | 534 | } |