mtd: onenand: omap2: Simplify the DMA setup for various paths
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Fri, 12 Jan 2018 13:15:25 +0000 (14:15 +0100)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Fri, 12 Jan 2018 14:34:17 +0000 (15:34 +0100)
commit3621311695f5b1a9396ae95098ac904328eefde7
treeb2c9d11fc24acdb9b2825b68b614f78c8c2f16fe
parentd120568883a4676852caab2e3545c0d1a623376b
mtd: onenand: omap2: Simplify the DMA setup for various paths

We have 4 functions containing almost identical DMA setup code. Create one
function which can set up the DMA for both read and write and use this in
place for the setup code in the driver.
The new function will use wait_for_completion_io_timeout() and it will
figure out the best data_type to be used for the transfer instead of
hardwiring 32 or 16 bit data.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Roger Quadros <rogerq@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/onenand/omap2.c