hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/dma-buf/heaps/rk_cma_heap.c
....@@ -15,7 +15,7 @@
1515 #include <linux/cma.h>
1616 #include <linux/dma-buf.h>
1717 #include <linux/dma-heap.h>
18
-#include <linux/dma-contiguous.h>
18
+#include <linux/dma-map-ops.h>
1919 #include <linux/err.h>
2020 #include <linux/highmem.h>
2121 #include <linux/io.h>
....@@ -135,7 +135,7 @@
135135 dma_unmap_sgtable(attachment->dev, table, direction, attrs);
136136 }
137137
138
-static int
138
+static int __maybe_unused
139139 cma_heap_dma_buf_begin_cpu_access_partial(struct dma_buf *dmabuf,
140140 enum dma_data_direction direction,
141141 unsigned int offset,
....@@ -160,7 +160,7 @@
160160 return 0;
161161 }
162162
163
-static int
163
+static int __maybe_unused
164164 cma_heap_dma_buf_end_cpu_access_partial(struct dma_buf *dmabuf,
165165 enum dma_data_direction direction,
166166 unsigned int offset,
....@@ -334,8 +334,10 @@
334334 .unmap_dma_buf = cma_heap_unmap_dma_buf,
335335 .begin_cpu_access = cma_heap_dma_buf_begin_cpu_access,
336336 .end_cpu_access = cma_heap_dma_buf_end_cpu_access,
337
+#ifdef CONFIG_DMABUF_PARTIAL
337338 .begin_cpu_access_partial = cma_heap_dma_buf_begin_cpu_access_partial,
338339 .end_cpu_access_partial = cma_heap_dma_buf_end_cpu_access_partial,
340
+#endif
339341 .mmap = cma_heap_mmap,
340342 .vmap = cma_heap_vmap,
341343 .vunmap = cma_heap_vunmap,
....@@ -388,7 +390,7 @@
388390 kunmap_atomic(vaddr);
389391 /*
390392 * Avoid wasting time zeroing memory if the process
391
- * has been killed by SIGKILL
393
+ * has been killed by by SIGKILL
392394 */
393395 if (fatal_signal_pending(current))
394396 goto free_cma;
....@@ -518,8 +520,6 @@
518520
519521 if (!heap_dev)
520522 return -EINVAL;
521
-
522
- arch_setup_dma_ops(heap_dev, 0, 0, NULL, 0);
523523
524524 dma_coerce_mask_and_coherent(heap_dev, DMA_BIT_MASK(64));
525525