diff options
author | Suman Anna <s-anna@ti.com> | 2017-02-14 15:58:07 -0600 |
---|---|---|
committer | Sam Nelson <sam.nelson@ti.com> | 2017-02-16 06:06:07 -0500 |
commit | db57f481c01c4c39946707d06d04f3039bb5a9d3 (patch) | |
tree | 2b75e8a9fbd3acb8c592f7b1f0199d69a7498773 | |
parent | 1389059f01eabc1e853a384f0e5f51c4f3e4f197 (diff) | |
download | linuxutils-db57f481c01c4c39946707d06d04f3039bb5a9d3.tar.gz |
cmemk: Fix cmem_dma_buf_end_cpu_access() signature on 4.6+ kernels
Commit 18b862dcd57a ("dma-buf, drm, ion: Propagate error code from
dma_buf_start_cpu_access()") in Linux kernel has changed the signature
for the dma_buf's end_cpu_access() ops. It now returns an error code,
so adjust the signature for the cmem_dma_buf_end_cpu_access() function
appropriately based on the kernel version.
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
-rw-r--r-- | src/cmem/module/cmemk.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cmem/module/cmemk.c b/src/cmem/module/cmemk.c index b3dbcee..b1e39d4 100644 --- a/src/cmem/module/cmemk.c +++ b/src/cmem/module/cmemk.c @@ -1187,8 +1187,14 @@ static void cmem_dma_buf_kunmap(struct dma_buf *dmabuf, unsigned long offset, { } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)) +static int cmem_dma_buf_end_cpu_access(struct dma_buf *dmabuf, + enum dma_data_direction direction) +#else static void cmem_dma_buf_end_cpu_access(struct dma_buf *dmabuf, enum dma_data_direction direction) + +#endif { struct pool_buffer *entry = dmabuf->priv; @@ -1197,6 +1203,10 @@ static void cmem_dma_buf_end_cpu_access(struct dma_buf *dmabuf, /* TODO: Need to take care of case where kvirtp is not set */ outer_clean_range(entry->physp, entry->physp + entry->size); + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)) + return 0; +#endif } static int cmem_dmabuf_map_attach(struct dma_buf *dma_buf, |