Commit 9359ea46 authored by Adrian Hunter's avatar Adrian Hunter Committed by David Woodhouse

MTD: nandsim: suppress unnecessary warning

nand_base sometimes reads only 2 bytes of a 4 byte id.
It is OK.  Do not print a warning in that case.
Signed-off-by: default avatarAdrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 4f8f3af2
...@@ -1736,13 +1736,17 @@ static void ns_nand_write_byte(struct mtd_info *mtd, u_char byte) ...@@ -1736,13 +1736,17 @@ static void ns_nand_write_byte(struct mtd_info *mtd, u_char byte)
/* Check if chip is expecting command */ /* Check if chip is expecting command */
if (NS_STATE(ns->nxstate) != STATE_UNKNOWN && !(ns->nxstate & STATE_CMD_MASK)) { if (NS_STATE(ns->nxstate) != STATE_UNKNOWN && !(ns->nxstate & STATE_CMD_MASK)) {
/* /* Do not warn if only 2 id bytes are read */
* We are in situation when something else (not command) if (!(ns->regs.command == NAND_CMD_READID &&
* was expected but command was input. In this case ignore NS_STATE(ns->state) == STATE_DATAOUT_ID && ns->regs.count == 2)) {
* previous command(s)/state(s) and accept the last one. /*
*/ * We are in situation when something else (not command)
NS_WARN("write_byte: command (%#x) wasn't expected, expected state is %s, " * was expected but command was input. In this case ignore
"ignore previous states\n", (uint)byte, get_state_name(ns->nxstate)); * previous command(s)/state(s) and accept the last one.
*/
NS_WARN("write_byte: command (%#x) wasn't expected, expected state is %s, "
"ignore previous states\n", (uint)byte, get_state_name(ns->nxstate));
}
switch_to_ready_state(ns, NS_STATUS_FAILED(ns)); switch_to_ready_state(ns, NS_STATUS_FAILED(ns));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment