aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nandsim.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <dedekind@infradead.org>2006-10-20 04:23:56 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-10-21 11:44:23 -0400
commit82810b7b6cc7a74c68881a13b0eb66c7a6370fcc (patch)
treeefe74cb87d5fd878d8d84cabd60fdfdfeca8e353 /drivers/mtd/nand/nandsim.c
parenta86aaa6ddf32b0401e64e74174042866e0fb3e20 (diff)
[MTD] NAND: nandsim: support subpage write
As flash cannot do 0->1 bit transitions when programming, do not do this in the simulator too. This makes nandsim able to accept subpage writes. Signed-off-by: Artem Bityutskiy <dedekind@infradead.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/nand/nandsim.c')
-rw-r--r--drivers/mtd/nand/nandsim.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index 28ee78544ff2..abebcab47631 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -852,6 +852,7 @@ static void erase_sector(struct nandsim *ns)
852 */ 852 */
853static int prog_page(struct nandsim *ns, int num) 853static int prog_page(struct nandsim *ns, int num)
854{ 854{
855 int i;
855 union ns_mem *mypage; 856 union ns_mem *mypage;
856 u_char *pg_off; 857 u_char *pg_off;
857 858
@@ -867,7 +868,8 @@ static int prog_page(struct nandsim *ns, int num)
867 } 868 }
868 869
869 pg_off = NS_PAGE_BYTE_OFF(ns); 870 pg_off = NS_PAGE_BYTE_OFF(ns);
870 memcpy(pg_off, ns->buf.byte, num); 871 for (i = 0; i < num; i++)
872 pg_off[i] &= ns->buf.byte[i];
871 873
872 return 0; 874 return 0;
873} 875}