Commit 0bda3e19 authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by Brian Norris

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: default avatarNicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 0aec7ac9
...@@ -604,11 +604,10 @@ static int dma_xfer(struct fsmc_nand_data *host, void *buffer, int len, ...@@ -604,11 +604,10 @@ static int dma_xfer(struct fsmc_nand_data *host, void *buffer, int len,
ret = ret =
wait_for_completion_timeout(&host->dma_access_complete, wait_for_completion_timeout(&host->dma_access_complete,
msecs_to_jiffies(3000)); msecs_to_jiffies(3000));
if (ret <= 0) { if (ret == 0) {
dmaengine_terminate_all(chan); dmaengine_terminate_all(chan);
dev_err(host->dev, "wait_for_completion_timeout\n"); dev_err(host->dev, "wait_for_completion_timeout\n");
if (!ret) ret = -ETIMEDOUT;
ret = -ETIMEDOUT;
goto unmap_dma; goto unmap_dma;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment