diff options
author | Suman Anna <s-anna@ti.com> | 2017-07-13 11:52:05 -0500 |
---|---|---|
committer | Sam Nelson <sam.nelson@ti.com> | 2017-11-20 14:04:04 -0500 |
commit | c7605ea9ea88bfbc6f667c2437516ab389732286 (patch) | |
tree | bf1fc83a172b8003efe90cbfdfd7ec590e4cdc84 | |
parent | 2ab022006c5a078f1039e7dd3459f0f5aa8ed4ec (diff) | |
download | linuxutils-c7605ea9ea88bfbc6f667c2437516ab389732286.tar.gz |
cmemk: Fix the dma_buf ops names on 4.12+ kernels
The dma-buf ops .kmap_atomic, .kunmap_atomic, .kmap and .kunmap have
been renamed to .map_atomic, .unmap_atomic, .map and .unmap respectively
on 4.12+ kernels to avoid conflict with a kmap_atomic macro from the
Linux highmem.h header file. Fix the ops names in the current definitions
of cmem_dmabuf_ops, so that the CMEM module can be built against 4.12+
kernels properly.
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/dma-buf.h?id=f9b67f0014cba18f1aabb6fa9272335a043eb6fd
Signed-off-by: Suman Anna <s-anna@ti.com>
-rw-r--r-- | src/cmem/module/cmemk.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmem/module/cmemk.c b/src/cmem/module/cmemk.c index c682345..598e8d9 100644 --- a/src/cmem/module/cmemk.c +++ b/src/cmem/module/cmemk.c @@ -1342,10 +1342,17 @@ static const struct dma_buf_ops cmem_dmabuf_ops = { .release = cmem_dma_buf_release, .begin_cpu_access = cmem_dma_buf_begin_cpu_access, .end_cpu_access = cmem_dma_buf_end_cpu_access, +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)) .kmap_atomic = cmem_dma_buf_kmap, .kunmap_atomic = cmem_dma_buf_kunmap, .kmap = cmem_dma_buf_kmap, .kunmap = cmem_dma_buf_kunmap, +#else + .map_atomic = cmem_dma_buf_kmap, + .unmap_atomic = cmem_dma_buf_kunmap, + .map = cmem_dma_buf_kmap, + .unmap = cmem_dma_buf_kunmap, +#endif }; static void *map_virt_addr(phys_addr_t physp, unsigned long long size, struct vm_struct **vm) |