Skip to content

Commit

Permalink
dmaengine: make dma_submit_error() return an error code
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Dan Williams <djbw@fb.com>
  • Loading branch information
Dan Carpenter authored and Dan Williams committed Aug 23, 2013
1 parent c4dcf0e commit 71ea148
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/linux/dmaengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71ea148

Please sign in to comment.