summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2013-07-28 11:21:56 +0900
committerDavid Woodhouse <David.Woodhouse@intel.com>2013-08-05 21:05:43 +0100
commit6d07fcf7e0e5da20120af247804f2cc9d2af82ac (patch)
tree199b8a3084a043e35ee4e3fe92819e62c069d939 /drivers/mtd
parent3b8b8fa1ede2ea9f52a550fdddf2dda53ce52fc8 (diff)
downloadlinux-stable-6d07fcf7e0e5da20120af247804f2cc9d2af82ac.tar.gz
linux-stable-6d07fcf7e0e5da20120af247804f2cc9d2af82ac.tar.bz2
linux-stable-6d07fcf7e0e5da20120af247804f2cc9d2af82ac.zip
mtd: nandsim: use NS_RAW_OFFSET()
Use NS_RAW_OFFSET() to calculate the page offset in flash RAM image by (row, column) address. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/nandsim.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index 7aa7b19d2c13..0ff53ef68dc4 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -1489,7 +1489,7 @@ static void read_page(struct nandsim *ns, int num)
ns->regs.row, ns->regs.column + ns->regs.off);
if (do_read_error(ns, num))
return;
- pos = (loff_t)ns->regs.row * ns->geom.pgszoob + ns->regs.column + ns->regs.off;
+ pos = (loff_t)NS_RAW_OFFSET(ns) + ns->regs.off;
tx = read_file(ns, ns->cfile, ns->buf.byte, num, pos);
if (tx != num) {
NS_ERR("read_page: read error for page %d ret %ld\n", ns->regs.row, (long)tx);
@@ -1558,7 +1558,7 @@ static int prog_page(struct nandsim *ns, int num)
NS_DBG("prog_page: writing page %d\n", ns->regs.row);
pg_off = ns->file_buf + ns->regs.column + ns->regs.off;
- off = (loff_t)ns->regs.row * ns->geom.pgszoob + ns->regs.column + ns->regs.off;
+ off = (loff_t)NS_RAW_OFFSET(ns) + ns->regs.off;
if (!test_bit(ns->regs.row, ns->pages_written)) {
all = 1;
memset(ns->file_buf, 0xff, ns->geom.pgszoob);