* [patch] dmaengine: make dma_submit_error() return an error code
@ 2013-08-10 7:46 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2013-08-10 7:46 UTC (permalink / raw)
To: Dan Williams; +Cc: Vinod Koul, linux-kernel, kernel-janitors
The problem here is that the dma_xfer() functions in
drivers/ata/pata_arasan_cf.c and drivers/mtd/nand/fsmc_nand.c expect
dma_submit_error() to return an error code so they return 1 when they
intended to return a negative.
So far as I can tell, none of the ->tx_submit() functions ever do
return error codes so this patch should have no effect in the current
code.
I also changed it from a define to an inline.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 5692bc3..16321fb 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -38,7 +38,10 @@ typedef s32 dma_cookie_t;
#define DMA_MIN_COOKIE 1
#define DMA_MAX_COOKIE INT_MAX
-#define dma_submit_error(cookie) ((cookie) < 0 ? 1 : 0)
+static inline int dma_submit_error(dma_cookie_t cookie)
+{
+ return cookie < 0 ? cookie : 0;
+}
/**
* enum dma_status - DMA transaction status
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-08-10 7:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-10 7:46 [patch] dmaengine: make dma_submit_error() return an error code Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox