瀏覽代碼

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>
Boris Brezillon 8 年之前
父節點
當前提交
19649e2c16
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      drivers/mtd/nand/sunxi_nand.c

+ 4 - 0
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 {