diff options
author | Boris Brezillon <boris.brezillon@free-electrons.com> | 2017-01-06 10:42:05 +0100 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2017-02-06 09:35:14 +0100 |
commit | 19649e2c16fbc94b664f7074ec4fa9f15292fdce (patch) | |
tree | 426371000f0207a667be3fccfaac9f0cb1e14435 /drivers/mtd/nand | |
parent | 656441478ed55d960df5f3ccdf5a0f8c61dfd0b3 (diff) | |
download | op-kernel-dev-19649e2c16fbc94b664f7074ec4fa9f15292fdce.zip op-kernel-dev-19649e2c16fbc94b664f7074ec4fa9f15292fdce.tar.gz |
mtd: nand: sunxi: Fix the non-polling case in sunxi_nfc_wait_events()
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>
Diffstat (limited to 'drivers/mtd/nand')
-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 e40482a..ba78e13 100644 --- a/drivers/mtd/nand/sunxi_nand.c +++ b/drivers/mtd/nand/sunxi_nand.c @@ -321,6 +321,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 { |