Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82810b7b authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by David Woodhouse
Browse files

[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: default avatarArtem Bityutskiy <dedekind@infradead.org>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent a86aaa6d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;

@@ -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;
}