]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
dma-buf: Constify ops argument to dma_buf_export()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 26 Jan 2012 11:27:22 +0000 (12:27 +0100)
committerSumit Semwal <sumit.semwal@ti.com>
Thu, 26 Jan 2012 17:09:02 +0000 (22:39 +0530)
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>
drivers/base/dma-buf.c
include/linux/dma-buf.h

index e38ad243b4bbec7104e305cada1d15199299e4f2..965833acf0d24b2e760497f2771756dc715b29a0 100644 (file)
@@ -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;
index f8ac076afa52c211c50621e4d01101becce7bc4b..86f6241410482efefe77322c1b8c3b72a0b99eb2 100644 (file)
@@ -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);
@@ -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);
 }