Skip to content

Commit

Permalink
[MTD] NAND: nandsim: support subpage write
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Artem Bityutskiy authored and David Woodhouse committed Oct 21, 2006
1 parent a86aaa6 commit 82810b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/mtd/nand/nandsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@ static void erase_sector(struct nandsim *ns)
*/
static int prog_page(struct nandsim *ns, int num)
{
int i;
union ns_mem *mypage;
u_char *pg_off;

Expand All @@ -867,7 +868,8 @@ static int prog_page(struct nandsim *ns, int num)
}

pg_off = NS_PAGE_BYTE_OFF(ns);
memcpy(pg_off, ns->buf.byte, num);
for (i = 0; i < num; i++)
pg_off[i] &= ns->buf.byte[i];

return 0;
}
Expand Down

0 comments on commit 82810b7

Please sign in to comment.