mtd: fsmc_nand: match wait_for_completion_timeout return type
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=818a45b1d7fbd8c55a4248fe6cd0995e06db04be
Commit: 818a45b1d7fbd8c55a4248fe6cd0995e06db04be
Parent: 0bda3e194438dd6801b863e7a9c23ca80a7cff05
Author: Nicholas Mc Guire <hofrat at osadl.org>
AuthorDate: Fri Mar 13 07:54:46 2015 -0400
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed May 6 23:48:04 2015 -0700
mtd: fsmc_nand: match wait_for_completion_timeout return type
return type of wait_for_completion_timeout is unsigned long not int. An
appropriately named unsigned long is added and the assignment fixed up.
This not only should help readability but also handles corner cases
properly.
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, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index b6306b1..793872f 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -562,6 +562,7 @@ static int dma_xfer(struct fsmc_nand_data *host, void *buffer, int len,
dma_cookie_t cookie;
unsigned long flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;
int ret;
+ unsigned long time_left;
if (direction == DMA_TO_DEVICE)
chan = host->write_dma_chan;
@@ -601,10 +602,10 @@ static int dma_xfer(struct fsmc_nand_data *host, void *buffer, int len,
dma_async_issue_pending(chan);
- ret =
+ time_left =
wait_for_completion_timeout(&host->dma_access_complete,
msecs_to_jiffies(3000));
- if (ret == 0) {
+ if (time_left == 0) {
dmaengine_terminate_all(chan);
dev_err(host->dev, "wait_for_completion_timeout\n");
ret = -ETIMEDOUT;
More information about the linux-mtd-cvs
mailing list