diff options
author | Pawel Osciak <pawel@osciak.com> | 2011-03-14 10:38:24 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 19:41:58 -0300 |
commit | 472af2b05bdefcaee7e754e22cbf131110017ad6 (patch) | |
tree | e3fe18e25905bb069518e00b5a4d2f75a58f42f9 /include/media | |
parent | d6db5bfe7fd6d4334a1460923ba8175f1a0ece2d (diff) |
[media] videobuf2-dma-contig: make cookie() return a pointer to dma_addr_t
dma_addr_t may not fit into void* on some architectures. To be safe, make
vb2_dma_contig_cookie() return a pointer to dma_addr_t and dereference it
in vb2_dma_contig_plane_paddr() back to dma_addr_t.
Signed-off-by: Pawel Osciak <pawel@osciak.com>
Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/videobuf2-dma-contig.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/media/videobuf2-dma-contig.h b/include/media/videobuf2-dma-contig.h index 1d6188d00efd..7e6c68b23773 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); |