Commit a50b0c20 authored by Boris Brezillon's avatar Boris Brezillon Committed by Miquel Raynal
Browse files

mtd: rawnand: diskonchip: Make sure doc2001plus_readbuf() works for single byte reads



Single byte accesses normally go through read_byte() but we are about
to use this function in the exec_op() implementation and thus needs to
prepare for single byte reads.

Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200501143917.1388957-2-boris.brezillon@collabora.com
parent dace12cc
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -550,9 +550,12 @@ static void doc2001plus_readbuf(struct nand_chip *this, u_char *buf, int len)
	}

	/* Terminate read pipeline */
	if (len >= 2) {
		buf[len - 2] = ReadDOC(docptr, Mplus_LastDataRead);
		if (debug && i < 16)
			printk("%02x ", buf[len - 2]);
	}

	buf[len - 1] = ReadDOC(docptr, Mplus_LastDataRead);
	if (debug && i < 16)
		printk("%02x ", buf[len - 1]);