summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-09-21 05:51:03 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2017-09-21 05:51:03 -1000
commit20c29a97559c9a59991170d3d648884a9f6aacd3 (patch)
tree2e59d9f29fd9b767adba2b303ca96cdf8b7854aa /drivers
parentc52f56a69d104d5294af3d652776d94b1ef6a175 (diff)
parent6d57339890c9a9dfcd4ba4f8931b911b962968e3 (diff)
downloadlinux-20c29a97559c9a59991170d3d648884a9f6aacd3.tar.bz2
Merge tag 'dma-mapping-4.14-2' of git://git.infradead.org/users/hch/dma-mapping
Pull dma mapping fix from Christoph Hellwig: "A fix for a fix that went in this merge window from Arnd" * tag 'dma-mapping-4.14-2' of git://git.infradead.org/users/hch/dma-mapping: dma-coherent: fix rmem_dma_device_init regression
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/dma-coherent.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/base/dma-coherent.c b/drivers/base/dma-coherent.c
index a39b2166b145..744f64f43454 100644
--- a/drivers/base/dma-coherent.c
+++ b/drivers/base/dma-coherent.c
@@ -348,16 +348,15 @@ static int rmem_dma_device_init(struct reserved_mem *rmem, struct device *dev)
struct dma_coherent_mem *mem = rmem->priv;
int ret;
- if (!mem)
- return -ENODEV;
-
- ret = dma_init_coherent_memory(rmem->base, rmem->base, rmem->size,
- DMA_MEMORY_EXCLUSIVE, &mem);
-
- if (ret) {
- pr_err("Reserved memory: failed to init DMA memory pool at %pa, size %ld MiB\n",
- &rmem->base, (unsigned long)rmem->size / SZ_1M);
- return ret;
+ if (!mem) {
+ ret = dma_init_coherent_memory(rmem->base, rmem->base,
+ rmem->size,
+ DMA_MEMORY_EXCLUSIVE, &mem);
+ if (ret) {
+ pr_err("Reserved memory: failed to init DMA memory pool at %pa, size %ld MiB\n",
+ &rmem->base, (unsigned long)rmem->size / SZ_1M);
+ return ret;
+ }
}
mem->use_dev_dma_pfn_offset = true;
rmem->priv = mem;