diff options
author | Boris Brezillon <boris.brezillon@free-electrons.com> | 2017-10-07 22:36:52 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-08 09:08:35 (GMT) |
commit | 293c98f15d048148a0130da293cc855721dd4fd8 (patch) | |
tree | 27c0c5cb58623660fdd390e45bff2ff6b3db1e16 /drivers/mtd | |
parent | ceec8374d790f55315deda0cd076b2a556a808c0 (diff) | |
download | linux-293c98f15d048148a0130da293cc855721dd4fd8.tar.xz |
mtd: nand: sunxi: Fix the non-polling case in sunxi_nfc_wait_events()
[ Upstream commit 19649e2c16fbc94b664f7074ec4fa9f15292fdce ]
wait_for_completion_timeout() returns 0 if a timeout occurred, 1
otherwise. Fix the sunxi_nfc_wait_events() accordingly.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/sunxi_nand.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c index 8b8470c..f9b2a77 100644 --- a/drivers/mtd/nand/sunxi_nand.c +++ b/drivers/mtd/nand/sunxi_nand.c @@ -320,6 +320,10 @@ static int sunxi_nfc_wait_events(struct sunxi_nfc *nfc, u32 events, ret = wait_for_completion_timeout(&nfc->complete, msecs_to_jiffies(timeout_ms)); + if (!ret) + ret = -ETIMEDOUT; + else + ret = 0; writel(0, nfc->regs + NFC_REG_INT); } else { |