i2c: rcar: update to new DMAENGINE API when terminating
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 8 Dec 2021 08:45:42 +0000 (09:45 +0100)
committerWolfram Sang <wsa@kernel.org>
Thu, 16 Dec 2021 21:22:56 +0000 (22:22 +0100)
commita5f7cf953f2b47e5025a7acd1698eea997b2fd94
treeea3c04265ebda30cab1a93378c4f780586537745
parentac18935d2e5130744b9675f6fb72acb783f86d77
i2c: rcar: update to new DMAENGINE API when terminating

dmaengine_terminate_all() is deprecated. When converting the existing
calls, it turned out that the termination in the interrupt handlers was
superfluous and only a side effect of simply calling
rcar_i2c_cleanup_dma(). As either no DMA transfers have been submitted
yet or the last one has successfully completed, there is nothing to
terminate and we can leave it out. So, merge the DMA unmap and cleanup
function to save some code. Then, add a flag if the new cleanup function
needs to terminate DMA. This is only the case for the erorr handling in
the main thread, so we can finally switch from dmaengine_terminate_all()
to dmaengine_terminate_sync() here.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-rcar.c