mtd: nand: tango: Enforce DMA direction type
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Mon, 20 Feb 2017 13:10:07 +0000 (14:10 +0100)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Thu, 16 Mar 2017 09:26:23 +0000 (10:26 +0100)
commit2d3c8565ba16aa323dfc98794bd56ef73b7e2d6c
tree9919aa4866a4d4d718bae6bb616bbebd036c2a8b
parent370cbc1afda1ebc1dca1b98c1b73a977b1a15164
mtd: nand: tango: Enforce DMA direction type

do_dma() uses an int to pass the DMA data direction information and
pass the same value to dmaengine_prep_slave_sg().

Currently, DMA_{FROM,TO}_DEVICE match DMA_{DEV_TO_MEM,MEM_TO_DEV}
definitions so it works fine, but assuming this will always be the case
is not safe.

Enforce enum dma_data_direction type in the function prototype and make
the enum dma_data_direction -> enum dma_transfer_direction conversion
explicit.

Reported-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
drivers/mtd/nand/tango_nand.c