From b76c9134369e2163b9af4daa6ea1f77a39a065c5 Mon Sep 17 00:00:00 2001 From: Amit Pundir Date: Tue, 7 Jul 2015 01:09:40 +0530 Subject: [PATCH] video: adf: build fixes for 4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Couple of ADF build fixes for v4.1 adf/adf_fops.c fix: get_unused_fd() is obsolete, use get_unused_fd_flags(O_CLOEXEC) instead to allocate a default file descriptor. This fix is a followup of upstream commit f938612dd97d "include/linux/file.h: remove get_unused_fd() macro". adf/adf_memblock.c fix: Fix dma_buf_export() call. Based on mainline commit d8fbe341beb6 "dma-buf: cleanup dma_buf_export() to make it easily extensible". Otherwise we run into following build failures: ---------- CC drivers/video/adf/adf_fops.o CC drivers/video/adf/adf_memblock.o drivers/video/adf/adf_memblock.c: In function ‘adf_memblock_export’: drivers/video/adf/adf_memblock.c:154:2: warning: passing argument 1 of ‘dma_buf_export’ from incompatible pointer type [enabled by default] In file included from drivers/video/adf/adf_memblock.c:15:0: include/linux/dma-buf.h:211:17: note: expected ‘const struct dma_buf_export_info *’ but argument is of type ‘struct adf_memblock_pdata *’ drivers/video/adf/adf_memblock.c:154:2: error: too many arguments to function ‘dma_buf_export’ In file included from drivers/video/adf/adf_memblock.c:15:0: include/linux/dma-buf.h:211:17: note: declared here make[3]: *** [drivers/video/adf/adf_memblock.o] Error 1 make[3]: *** Waiting for unfinished jobs.... drivers/video/adf/adf_fops.c: In function ‘adf_device_post_config’: drivers/video/adf/adf_fops.c:228:2: error: implicit declaration of function ‘get_unused_fd’ [-Werror=implicit-function-declaration] cc1: some warnings being treated as errors make[3]: *** [drivers/video/adf/adf_fops.o] Error 1 make[2]: *** [drivers/video/adf] Error 2 make[2]: *** Waiting for unfinished jobs.... ---------- Signed-off-by: Amit Pundir --- drivers/video/adf/adf_fops.c | 4 ++-- drivers/video/adf/adf_memblock.c | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/video/adf/adf_fops.c b/drivers/video/adf/adf_fops.c index 7fbf33e1cb39..8726617f73ab 100644 --- a/drivers/video/adf/adf_fops.c +++ b/drivers/video/adf/adf_fops.c @@ -225,7 +225,7 @@ static int adf_device_post_config(struct adf_device *dev, size_t custom_data_size; int ret = 0; - complete_fence_fd = get_unused_fd(); + complete_fence_fd = get_unused_fd_flags(O_CLOEXEC); if (complete_fence_fd < 0) return complete_fence_fd; @@ -347,7 +347,7 @@ static int adf_intf_simple_post_config(struct adf_interface *intf, struct adf_buffer buf; int ret = 0; - complete_fence_fd = get_unused_fd(); + complete_fence_fd = get_unused_fd_flags(O_CLOEXEC); if (complete_fence_fd < 0) return complete_fence_fd; diff --git a/drivers/video/adf/adf_memblock.c b/drivers/video/adf/adf_memblock.c index ab583f838db2..285218a08e8f 100644 --- a/drivers/video/adf/adf_memblock.c +++ b/drivers/video/adf/adf_memblock.c @@ -142,6 +142,7 @@ struct dma_buf *adf_memblock_export(phys_addr_t base, size_t size, int flags) { struct adf_memblock_pdata *pdata; struct dma_buf *buf; + DEFINE_DMA_BUF_EXPORT_INFO(exp_info); if (PAGE_ALIGN(base) != base || PAGE_ALIGN(size) != size) return ERR_PTR(-EINVAL); @@ -151,7 +152,12 @@ struct dma_buf *adf_memblock_export(phys_addr_t base, size_t size, int flags) return ERR_PTR(-ENOMEM); pdata->base = base; - buf = dma_buf_export(pdata, &adf_memblock_ops, size, flags, NULL); + exp_info.ops = &adf_memblock_ops; + exp_info.size = size; + exp_info.flags = flags; + exp_info.priv = pdata; + + buf = dma_buf_export(&exp_info); if (IS_ERR(buf)) kfree(pdata); -- 2.34.1