mtd: rawnand: Propagate error and simplify ternary operators for brcmstb_nand_wait_fo...
authorRuan Jinjie <ruanjinjie@huawei.com>
Tue, 8 Aug 2023 03:29:43 +0000 (11:29 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 18 Aug 2023 14:38:33 +0000 (16:38 +0200)
commitf504551b7f153c52e52154b989266c11a17590f3
tree3f8526f242851dccea6713f8fe61b7ed11e07886
parent93ca966b4a2022c2f70ca08b6769e0276a630fa0
mtd: rawnand: Propagate error and simplify ternary operators for brcmstb_nand_wait_for_completion()

As bcmnand_ctrl_poll_status() return negative errno, so return true if
sts < 0. The < 0 case does not exist for wait_for_completion_timeout(),
so return true if sts = 0 and zero otherwise. Both of the true return
of them can be considered as a -ETIMEDOUT err, so return -ETIMEDOUT
if err is true to propagate err from its caller.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230808032943.3890545-1-ruanjinjie@huawei.com
drivers/mtd/nand/raw/brcmnand/brcmnand.c