diff options
author | Scott Wood <swood@redhat.com> | 2019-05-09 16:08:27 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-24 20:32:12 +0200 |
commit | 13069847a475b60069918dc9971f5adb42811ce3 (patch) | |
tree | 94ba9ceda4e4f9c0f6998ce93257a526a1a5c21a | |
parent | f5dd87326fefe42a4b1a4b1a1a695060c33a88d6 (diff) | |
download | linux-13069847a475b60069918dc9971f5adb42811ce3.tar.gz linux-13069847a475b60069918dc9971f5adb42811ce3.tar.bz2 linux-13069847a475b60069918dc9971f5adb42811ce3.zip |
fpga: dfl: afu: Pass the correct device to dma_mapping_error()
dma_mapping_error() was being called on a different device struct than
what was passed to map/unmap. Besides rendering the error checking
ineffective, it caused a debug splat with CONFIG_DMA_API_DEBUG.
Signed-off-by: Scott Wood <swood@redhat.com>
Acked-by: Wu Hao <hao.wu@intel.com>
Acked-by: Moritz Fischer <mdf@kernel.org>
Acked-by: Alan Tull <atull@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/fpga/dfl-afu-dma-region.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/fpga/dfl-afu-dma-region.c b/drivers/fpga/dfl-afu-dma-region.c index c438722bf4e1..dcd80b088c7b 100644 --- a/drivers/fpga/dfl-afu-dma-region.c +++ b/drivers/fpga/dfl-afu-dma-region.c @@ -399,7 +399,7 @@ int afu_dma_map_region(struct dfl_feature_platform_data *pdata, region->pages[0], 0, region->length, DMA_BIDIRECTIONAL); - if (dma_mapping_error(&pdata->dev->dev, region->iova)) { + if (dma_mapping_error(dfl_fpga_pdata_to_parent(pdata), region->iova)) { dev_err(&pdata->dev->dev, "failed to map for dma\n"); ret = -EFAULT; goto unpin_pages; |