mtd: fsmc_nand: fix handling of wait_for_completion_timeout return value

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jun 23 10:59:02 PDT 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=0bda3e194438dd6801b863e7a9c23ca80a7cff05
Commit:     0bda3e194438dd6801b863e7a9c23ca80a7cff05
Parent:     0aec7ac997b784dfc83125cd120d2bd5d3851eb6
Author:     Nicholas Mc Guire <hofrat at osadl.org>
AuthorDate: Fri Mar 13 07:54:45 2015 -0400
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed May 6 23:47:31 2015 -0700

    mtd: fsmc_nand: fix handling of wait_for_completion_timeout return value
    
    wait_for_completion_timeout does not return negative values so
    result handling here does not need to check for negative return.
    
    Signed-off-by: Nicholas Mc Guire <hofrat at osadl.org>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/fsmc_nand.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index e58af4b..b6306b1 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -604,11 +604,10 @@ static int dma_xfer(struct fsmc_nand_data *host, void *buffer, int len,
 	ret =
 	wait_for_completion_timeout(&host->dma_access_complete,
 				msecs_to_jiffies(3000));
-	if (ret <= 0) {
+	if (ret == 0) {
 		dmaengine_terminate_all(chan);
 		dev_err(host->dev, "wait_for_completion_timeout\n");
-		if (!ret)
-			ret = -ETIMEDOUT;
+		ret = -ETIMEDOUT;
 		goto unmap_dma;
 	}
 



More information about the linux-mtd-cvs mailing list