aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nandsim.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/nandsim.c')
-rw-r--r--drivers/mtd/nand/nandsim.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index ae7c57781a68..fdf82cf24449 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -1736,13 +1736,17 @@ static void ns_nand_write_byte(struct mtd_info *mtd, u_char byte)
1736 1736
1737 /* Check if chip is expecting command */ 1737 /* Check if chip is expecting command */
1738 if (NS_STATE(ns->nxstate) != STATE_UNKNOWN && !(ns->nxstate & STATE_CMD_MASK)) { 1738 if (NS_STATE(ns->nxstate) != STATE_UNKNOWN && !(ns->nxstate & STATE_CMD_MASK)) {
1739 /* 1739 /* Do not warn if only 2 id bytes are read */
1740 * We are in situation when something else (not command) 1740 if (!(ns->regs.command == NAND_CMD_READID &&
1741 * was expected but command was input. In this case ignore 1741 NS_STATE(ns->state) == STATE_DATAOUT_ID && ns->regs.count == 2)) {
1742 * previous command(s)/state(s) and accept the last one. 1742 /*
1743 */ 1743 * We are in situation when something else (not command)
1744 NS_WARN("write_byte: command (%#x) wasn't expected, expected state is %s, " 1744 * was expected but command was input. In this case ignore
1745 "ignore previous states\n", (uint)byte, get_state_name(ns->nxstate)); 1745 * previous command(s)/state(s) and accept the last one.
1746 */
1747 NS_WARN("write_byte: command (%#x) wasn't expected, expected state is %s, "
1748 "ignore previous states\n", (uint)byte, get_state_name(ns->nxstate));
1749 }
1746 switch_to_ready_state(ns, NS_STATUS_FAILED(ns)); 1750 switch_to_ready_state(ns, NS_STATUS_FAILED(ns));
1747 } 1751 }
1748 1752