aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2016-07-21 08:14:02 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-08-24 09:10:40 -0400
commit0ff657b0f6120cb53f98b1b42c87af34670edff5 (patch)
tree9baee4a0202c7a51056e016f16bcfb575a1133da /include/media
parent82019205e3a8fc687c4ee6538b57039884be4ccc (diff)
[media] vb2: don't return NULL for alloc and get_userptr ops
Always return an ERR_PTR() instead of NULL. This makes the behavior of alloc, get_userptr and attach_dmabuf the same. Update the documentation in videobuf2-core.h as well. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/videobuf2-core.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index a4a9a55a0c42..b6546db670ca 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -33,7 +33,7 @@ struct vb2_threadio_data;
33/** 33/**
34 * struct vb2_mem_ops - memory handling/memory allocator operations 34 * struct vb2_mem_ops - memory handling/memory allocator operations
35 * @alloc: allocate video memory and, optionally, allocator private data, 35 * @alloc: allocate video memory and, optionally, allocator private data,
36 * return NULL on failure or a pointer to allocator private, 36 * return ERR_PTR() on failure or a pointer to allocator private,
37 * per-buffer data on success; the returned private structure 37 * per-buffer data on success; the returned private structure
38 * will then be passed as buf_priv argument to other ops in this 38 * will then be passed as buf_priv argument to other ops in this
39 * structure. Additional gfp_flags to use when allocating the 39 * structure. Additional gfp_flags to use when allocating the
@@ -50,14 +50,14 @@ struct vb2_threadio_data;
50 * USERPTR memory types; vaddr is the address passed to the 50 * USERPTR memory types; vaddr is the address passed to the
51 * videobuf layer when queuing a video buffer of USERPTR type; 51 * videobuf layer when queuing a video buffer of USERPTR type;
52 * should return an allocator private per-buffer structure 52 * should return an allocator private per-buffer structure
53 * associated with the buffer on success, NULL on failure; 53 * associated with the buffer on success, ERR_PTR() on failure;
54 * the returned private structure will then be passed as buf_priv 54 * the returned private structure will then be passed as buf_priv
55 * argument to other ops in this structure. 55 * argument to other ops in this structure.
56 * @put_userptr: inform the allocator that a USERPTR buffer will no longer 56 * @put_userptr: inform the allocator that a USERPTR buffer will no longer
57 * be used. 57 * be used.
58 * @attach_dmabuf: attach a shared struct dma_buf for a hardware operation; 58 * @attach_dmabuf: attach a shared struct dma_buf for a hardware operation;
59 * used for DMABUF memory types; dev is the alloc device 59 * used for DMABUF memory types; dev is the alloc device
60 * dbuf is the shared dma_buf; returns NULL on failure; 60 * dbuf is the shared dma_buf; returns ERR_PTR() on failure;
61 * allocator private per-buffer structure on success; 61 * allocator private per-buffer structure on success;
62 * this needs to be used for further accesses to the buffer. 62 * this needs to be used for further accesses to the buffer.
63 * @detach_dmabuf: inform the exporter of the buffer that the current DMABUF 63 * @detach_dmabuf: inform the exporter of the buffer that the current DMABUF