OSDN Git Service

mtd: fsmc_nand: fix handling of wait_for_completion_timeout return value
authorNicholas Mc Guire <hofrat@osadl.org>
Fri, 13 Mar 2015 11:54:45 +0000 (07:54 -0400)
committerBrian Norris <computersforpeace@gmail.com>
Thu, 7 May 2015 06:47:31 +0000 (23:47 -0700)
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@osadl.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/fsmc_nand.c

index e58af4b..b6306b1 100644 (file)
@@ -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;
        }