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>
  */
 static int prog_page(struct nandsim *ns, int num)
 {
+       int i;
        union ns_mem *mypage;
        u_char *pg_off;
 
        }
 
        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;
 }