mtd: rawnand: marvell: Fix the condition on a return code
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 24 Apr 2020 16:44:56 +0000 (18:44 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 11 May 2020 07:51:39 +0000 (09:51 +0200)
commitc27075772d1f1c8aaf276db9943b35adda8a8b65
tree51f827f719519bb7c2fb460dc5e41bbe7fd16927
parentd10b41ba02fee57569ad2aacb723f7c91b6b2729
mtd: rawnand: marvell: Fix the condition on a return code

In a previous fix, I changed the condition on which the timeout of an
IRQ is reached from:

    if (!ret)

into:

    if (ret && !pending)

While having a non-zero return code is usual in the Linux kernel, here
ret comes from a wait_for_completion_timeout() which returns 0 when
the waiting period is too long.

Hence, the revised condition should be:

    if (!ret && !pending)

The faulty patch did not produce any error because of the !pending
condition so this change is finally purely cosmetic and does not
change the actual driver behavior.

Fixes: cafb56dd741e ("mtd: rawnand: marvell: prevent timeouts on a loaded machine")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-2-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/marvell_nand.c