diff options
author | Sumit Semwal <sumit.semwal@linaro.org> | 2015-01-23 02:23:43 -0500 |
---|---|---|
committer | Sumit Semwal <sumit.semwal@linaro.org> | 2015-04-21 05:17:16 -0400 |
commit | d8fbe341beb617ebb22b98fb893e4aa32ae2d864 (patch) | |
tree | 2e19c951d2b6ffef2319d87ec8a6c39e4e1ab8ee /drivers/media/v4l2-core/videobuf2-vmalloc.c | |
parent | 646da63172f660ba84f195c1165360a9b73583ee (diff) |
dma-buf: cleanup dma_buf_export() to make it easily extensible
At present, dma_buf_export() takes a series of parameters, which
makes it difficult to add any new parameters for exporters, if required.
Make it simpler by moving all these parameters into a struct, and pass
the struct * as parameter to dma_buf_export().
While at it, unite dma_buf_export_named() with dma_buf_export(), and
change all callers accordingly.
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Diffstat (limited to 'drivers/media/v4l2-core/videobuf2-vmalloc.c')
-rw-r--r-- | drivers/media/v4l2-core/videobuf2-vmalloc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-vmalloc.c b/drivers/media/v4l2-core/videobuf2-vmalloc.c index bcde88572429..657ab302a5cf 100644 --- a/drivers/media/v4l2-core/videobuf2-vmalloc.c +++ b/drivers/media/v4l2-core/videobuf2-vmalloc.c | |||
@@ -368,11 +368,17 @@ static struct dma_buf *vb2_vmalloc_get_dmabuf(void *buf_priv, unsigned long flag | |||
368 | { | 368 | { |
369 | struct vb2_vmalloc_buf *buf = buf_priv; | 369 | struct vb2_vmalloc_buf *buf = buf_priv; |
370 | struct dma_buf *dbuf; | 370 | struct dma_buf *dbuf; |
371 | DEFINE_DMA_BUF_EXPORT_INFO(exp_info); | ||
372 | |||
373 | exp_info.ops = &vb2_vmalloc_dmabuf_ops; | ||
374 | exp_info.size = buf->size; | ||
375 | exp_info.flags = flags; | ||
376 | exp_info.priv = buf; | ||
371 | 377 | ||
372 | if (WARN_ON(!buf->vaddr)) | 378 | if (WARN_ON(!buf->vaddr)) |
373 | return NULL; | 379 | return NULL; |
374 | 380 | ||
375 | dbuf = dma_buf_export(buf, &vb2_vmalloc_dmabuf_ops, buf->size, flags, NULL); | 381 | dbuf = dma_buf_export(&exp_info); |
376 | if (IS_ERR(dbuf)) | 382 | if (IS_ERR(dbuf)) |
377 | return NULL; | 383 | return NULL; |
378 | 384 | ||