Browse Source

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@osadl.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Nicholas Mc Guire 10 years ago
parent
commit
818a45b1d7
1 changed files with 3 additions and 2 deletions
  1. 3 2
      drivers/mtd/nand/fsmc_nand.c

+ 3 - 2
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;
 	dma_cookie_t cookie;
 	unsigned long flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;
 	unsigned long flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;
 	int ret;
 	int ret;
+	unsigned long time_left;
 
 
 	if (direction == DMA_TO_DEVICE)
 	if (direction == DMA_TO_DEVICE)
 		chan = host->write_dma_chan;
 		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);
 	dma_async_issue_pending(chan);
 
 
-	ret =
+	time_left =
 	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 (time_left == 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");
 		ret = -ETIMEDOUT;
 		ret = -ETIMEDOUT;