Skip to content

Commit

Permalink
dma-buf: Constify ops argument to dma_buf_export()
Browse files Browse the repository at this point in the history
This allows drivers to make the dma buf operations structure constant.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
  • Loading branch information
Laurent Pinchart authored and Sumit Semwal committed Mar 19, 2012
1 parent c16fa4f commit 5375764
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/base/dma-buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static inline int is_dma_buf_file(struct file *file)
* ops, or error in allocating struct dma_buf, will return negative error.
*
*/
struct dma_buf *dma_buf_export(void *priv, struct dma_buf_ops *ops,
struct dma_buf *dma_buf_export(void *priv, const struct dma_buf_ops *ops,
size_t size, int flags)
{
struct dma_buf *dmabuf;
Expand Down
8 changes: 4 additions & 4 deletions include/linux/dma-buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
struct device *dev);
void dma_buf_detach(struct dma_buf *dmabuf,
struct dma_buf_attachment *dmabuf_attach);
struct dma_buf *dma_buf_export(void *priv, struct dma_buf_ops *ops,
size_t size, int flags);
struct dma_buf *dma_buf_export(void *priv, const struct dma_buf_ops *ops,
size_t size, int flags);
int dma_buf_fd(struct dma_buf *dmabuf);
struct dma_buf *dma_buf_get(int fd);
void dma_buf_put(struct dma_buf *dmabuf);
Expand All @@ -138,8 +138,8 @@ static inline void dma_buf_detach(struct dma_buf *dmabuf,
}

static inline struct dma_buf *dma_buf_export(void *priv,
struct dma_buf_ops *ops,
size_t size, int flags)
const struct dma_buf_ops *ops,
size_t size, int flags)
{
return ERR_PTR(-ENODEV);
}
Expand Down

0 comments on commit 5375764

Please sign in to comment.