mtd: nand: brcmnand: Zero bitflip is not an error
authorAlbert Hsieh <wen.hsieh@broadcom.com>
Mon, 20 Nov 2017 03:26:26 +0000 (11:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Mar 2018 09:24:23 +0000 (10:24 +0100)
commit6de1b002a29f86982b8662941ad97eec0741d3f8
tree457b9d6786ef74539a86bbbb5f2ae375f50a5ea1
parentf485259011ad644d91a7ccc40bfaaafea72974f9
mtd: nand: brcmnand: Zero bitflip is not an error

[ Upstream commit e44b9a9c135727f3410e029910275f40681dc8bc ]

A negative return value of brcmstb_nand_verify_erased_page() indicates a
real bitflip error of an erased page, and other return values (>= 0) show
the corrected bitflip number. Zero return value means no bitflip, but the
current driver code treats it as an error, and eventually leads to
falsely reported ECC error.

Fixes: 02b88eea9f9c ("mtd: brcmnand: Add check for erased page bitflip")
Signed-off-by: Albert Hsieh <wen.hsieh@broadcom.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/nand/brcmnand/brcmnand.c