dmaengine: mv_xor: Use correct device for DMA API
authorRobin Murphy <robin.murphy@arm.com>
Mon, 18 Feb 2019 18:27:06 +0000 (18:27 +0000)
committerVinod Koul <vkoul@kernel.org>
Tue, 19 Feb 2019 12:10:35 +0000 (17:40 +0530)
commit3e5daee5ecf314da33a890fabaa2404244cd2a36
tree580fa7a26b5f8b4e6147a0bee470058f6d4a59f4
parent85ed4f43db866fe1ea90bcca8cd1e5e628f04a6f
dmaengine: mv_xor: Use correct device for DMA API

Using dma_dev->dev for mappings before it's assigned with the correct
device is unlikely to work as expected, and with future dma-direct
changes, passing a NULL device may end up crashing entirely. I don't
know enough about this hardware or the mv_xor_prep_dma_interrupt()
operation to implement the appropriate error-handling logic that would
have revealed those dma_map_single() calls failing on arm64 for as long
as the driver has been enabled there, but moving the assignment earlier
will at least make the current code operate as intended.

Fixes: 22843545b200 ("dma: mv_xor: Add support for DMA_INTERRUPT")
Reported-by: John David Anglin <dave.anglin@bell.net>
Tested-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Tested-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/mv_xor.c