i2c: sh_mobile: update to new DMAENGINE API when terminating
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 8 Dec 2021 08:45:43 +0000 (09:45 +0100)
committerWolfram Sang <wsa@kernel.org>
Thu, 16 Dec 2021 21:23:04 +0000 (22:23 +0100)
commit44df8a79283d94f4aed2e3a14ed67e49a3c210ca
tree1d3e483c84eeeb929693cbd480edd5a998473e21
parenta5f7cf953f2b47e5025a7acd1698eea997b2fd94
i2c: sh_mobile: 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 DMA setup and callback
were 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-sh_mobile.c