diff mbox

[2/2,media] videobuf2-dma-contig: make cookie() return a pointer to dma_addr_t

Message ID 1300109904-3991-2-git-send-email-pawel@osciak.com (mailing list archive)
State RFC
Headers show

Commit Message

Pawel Osciak March 14, 2011, 1:38 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/video/videobuf2-dma-contig.c b/drivers/media/video/videobuf2-dma-contig.c
index 90495b7..58205d5 100644
--- a/drivers/media/video/videobuf2-dma-contig.c
+++ b/drivers/media/video/videobuf2-dma-contig.c
@@ -78,7 +78,7 @@  static void *vb2_dma_contig_cookie(void *buf_priv)
 {
 	struct vb2_dc_buf *buf = buf_priv;
 
-	return (void *)buf->paddr;
+	return &buf->paddr;
 }
 
 static void *vb2_dma_contig_vaddr(void *buf_priv)
diff --git a/include/media/videobuf2-dma-contig.h b/include/media/videobuf2-dma-contig.h
index 1d6188d..7e6c68b 100644
--- a/include/media/videobuf2-dma-contig.h
+++ b/include/media/videobuf2-dma-contig.h
@@ -14,11 +14,14 @@ 
 #define _MEDIA_VIDEOBUF2_DMA_COHERENT_H
 
 #include <media/videobuf2-core.h>
+#include <linux/dma-mapping.h>
 
-static inline unsigned long vb2_dma_contig_plane_paddr(
-		struct vb2_buffer *vb, unsigned int plane_no)
+static inline dma_addr_t
+vb2_dma_contig_plane_paddr(struct vb2_buffer *vb, unsigned int plane_no)
 {
-	return (unsigned long)vb2_plane_cookie(vb, plane_no);
+	dma_addr_t *paddr = vb2_plane_cookie(vb, plane_no);
+
+	return *paddr;
 }
 
 void *vb2_dma_contig_init_ctx(struct device *dev);