summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2016-05-05 15:42:44 -0400
committerBoris Brezillon <boris.brezillon@free-electrons.com>2016-09-23 03:35:16 -0400
commit3fe4f900bf3061b3994c56eea497d8a839241277 (patch)
treeede617e78aa0a7d612c37356cd41548e6ddeab60
parentd9ca77f0eafabb5495542386777ab2833442089b (diff)
mtd: nand: sh_flctl: handle dma_submit() errors
Some build tools noticed that 'cookie' is being set but not used. Might as well catch the errors here and handle them the same way we handle other DMA prep steps. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
-rw-r--r--drivers/mtd/nand/sh_flctl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
index 6fa3bcd59769..442ce619b3b6 100644
--- a/drivers/mtd/nand/sh_flctl.c
+++ b/drivers/mtd/nand/sh_flctl.c
@@ -397,7 +397,7 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,
397 struct dma_chan *chan; 397 struct dma_chan *chan;
398 enum dma_transfer_direction tr_dir; 398 enum dma_transfer_direction tr_dir;
399 dma_addr_t dma_addr; 399 dma_addr_t dma_addr;
400 dma_cookie_t cookie = -EINVAL; 400 dma_cookie_t cookie;
401 uint32_t reg; 401 uint32_t reg;
402 int ret; 402 int ret;
403 403
@@ -423,6 +423,12 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,
423 desc->callback = flctl_dma_complete; 423 desc->callback = flctl_dma_complete;
424 desc->callback_param = flctl; 424 desc->callback_param = flctl;
425 cookie = dmaengine_submit(desc); 425 cookie = dmaengine_submit(desc);
426 if (dma_submit_error(cookie)) {
427 ret = dma_submit_error(cookie);
428 dev_warn(&flctl->pdev->dev,
429 "DMA submit failed, falling back to PIO\n");
430 goto out;
431 }
426 432
427 dma_async_issue_pending(chan); 433 dma_async_issue_pending(chan);
428 } else { 434 } else {