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 <amit.pundir@linaro.org>
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;
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;
{
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);
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);