diff options
Diffstat (limited to 'drivers/base/dma-buf.c')
-rw-r--r-- | drivers/base/dma-buf.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c index 2a7cb0df176b..d89102a29f65 100644 --- a/drivers/base/dma-buf.c +++ b/drivers/base/dma-buf.c | |||
@@ -77,22 +77,24 @@ static inline int is_dma_buf_file(struct file *file) | |||
77 | } | 77 | } |
78 | 78 | ||
79 | /** | 79 | /** |
80 | * dma_buf_export - Creates a new dma_buf, and associates an anon file | 80 | * dma_buf_export_named - Creates a new dma_buf, and associates an anon file |
81 | * with this buffer, so it can be exported. | 81 | * with this buffer, so it can be exported. |
82 | * Also connect the allocator specific data and ops to the buffer. | 82 | * Also connect the allocator specific data and ops to the buffer. |
83 | * Additionally, provide a name string for exporter; useful in debugging. | ||
83 | * | 84 | * |
84 | * @priv: [in] Attach private data of allocator to this buffer | 85 | * @priv: [in] Attach private data of allocator to this buffer |
85 | * @ops: [in] Attach allocator-defined dma buf ops to the new buffer. | 86 | * @ops: [in] Attach allocator-defined dma buf ops to the new buffer. |
86 | * @size: [in] Size of the buffer | 87 | * @size: [in] Size of the buffer |
87 | * @flags: [in] mode flags for the file. | 88 | * @flags: [in] mode flags for the file. |
89 | * @exp_name: [in] name of the exporting module - useful for debugging. | ||
88 | * | 90 | * |
89 | * Returns, on success, a newly created dma_buf object, which wraps the | 91 | * Returns, on success, a newly created dma_buf object, which wraps the |
90 | * supplied private data and operations for dma_buf_ops. On either missing | 92 | * supplied private data and operations for dma_buf_ops. On either missing |
91 | * ops, or error in allocating struct dma_buf, will return negative error. | 93 | * ops, or error in allocating struct dma_buf, will return negative error. |
92 | * | 94 | * |
93 | */ | 95 | */ |
94 | struct dma_buf *dma_buf_export(void *priv, const struct dma_buf_ops *ops, | 96 | struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops, |
95 | size_t size, int flags) | 97 | size_t size, int flags, const char *exp_name) |
96 | { | 98 | { |
97 | struct dma_buf *dmabuf; | 99 | struct dma_buf *dmabuf; |
98 | struct file *file; | 100 | struct file *file; |
@@ -114,6 +116,7 @@ struct dma_buf *dma_buf_export(void *priv, const struct dma_buf_ops *ops, | |||
114 | dmabuf->priv = priv; | 116 | dmabuf->priv = priv; |
115 | dmabuf->ops = ops; | 117 | dmabuf->ops = ops; |
116 | dmabuf->size = size; | 118 | dmabuf->size = size; |
119 | dmabuf->exp_name = exp_name; | ||
117 | 120 | ||
118 | file = anon_inode_getfile("dmabuf", &dma_buf_fops, dmabuf, flags); | 121 | file = anon_inode_getfile("dmabuf", &dma_buf_fops, dmabuf, flags); |
119 | 122 | ||
@@ -124,7 +127,7 @@ struct dma_buf *dma_buf_export(void *priv, const struct dma_buf_ops *ops, | |||
124 | 127 | ||
125 | return dmabuf; | 128 | return dmabuf; |
126 | } | 129 | } |
127 | EXPORT_SYMBOL_GPL(dma_buf_export); | 130 | EXPORT_SYMBOL_GPL(dma_buf_export_named); |
128 | 131 | ||
129 | 132 | ||
130 | /** | 133 | /** |