aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/videobuf2-dma-contig.c
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2011-08-29 02:20:56 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-09-06 14:05:10 -0400
commitba7fcb0c954921534707f08ebc4d8beeb2eb17e7 (patch)
tree0dc9929461e4ac2af79ab5bfffb1bdac181ad6c5 /drivers/media/video/videobuf2-dma-contig.c
parent035aa1475d6e4afdf97dccf6c6d6059063398b57 (diff)
[media] media: vb2: dma contig allocator: use dma_addr instread of paddr
Use the correct 'dma_addr' name for the buffer address. 'paddr' suggested that this is the physical address in system memory. For most ARM platforms these two are the same, but this is not a generic rule. 'dma_addr' will also point better to dma-mapping api. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> CC: Pawel Osciak <pawel@osciak.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/videobuf2-dma-contig.c')
-rw-r--r--drivers/media/video/videobuf2-dma-contig.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/media/video/videobuf2-dma-contig.c b/drivers/media/video/videobuf2-dma-contig.c
index a790a5f8c06..f17ad98fcc5 100644
--- a/drivers/media/video/videobuf2-dma-contig.c
+++ b/drivers/media/video/videobuf2-dma-contig.c
@@ -24,7 +24,7 @@ struct vb2_dc_conf {
24struct vb2_dc_buf { 24struct vb2_dc_buf {
25 struct vb2_dc_conf *conf; 25 struct vb2_dc_conf *conf;
26 void *vaddr; 26 void *vaddr;
27 dma_addr_t paddr; 27 dma_addr_t dma_addr;
28 unsigned long size; 28 unsigned long size;
29 struct vm_area_struct *vma; 29 struct vm_area_struct *vma;
30 atomic_t refcount; 30 atomic_t refcount;
@@ -42,7 +42,7 @@ static void *vb2_dma_contig_alloc(void *alloc_ctx, unsigned long size)
42 if (!buf) 42 if (!buf)
43 return ERR_PTR(-ENOMEM); 43 return ERR_PTR(-ENOMEM);
44 44
45 buf->vaddr = dma_alloc_coherent(conf->dev, size, &buf->paddr, 45 buf->vaddr = dma_alloc_coherent(conf->dev, size, &buf->dma_addr,
46 GFP_KERNEL); 46 GFP_KERNEL);
47 if (!buf->vaddr) { 47 if (!buf->vaddr) {
48 dev_err(conf->dev, "dma_alloc_coherent of size %ld failed\n", 48 dev_err(conf->dev, "dma_alloc_coherent of size %ld failed\n",
@@ -69,7 +69,7 @@ static void vb2_dma_contig_put(void *buf_priv)
69 69
70 if (atomic_dec_and_test(&buf->refcount)) { 70 if (atomic_dec_and_test(&buf->refcount)) {
71 dma_free_coherent(buf->conf->dev, buf->size, buf->vaddr, 71 dma_free_coherent(buf->conf->dev, buf->size, buf->vaddr,
72 buf->paddr); 72 buf->dma_addr);
73 kfree(buf); 73 kfree(buf);
74 } 74 }
75} 75}
@@ -78,7 +78,7 @@ static void *vb2_dma_contig_cookie(void *buf_priv)
78{ 78{
79 struct vb2_dc_buf *buf = buf_priv; 79 struct vb2_dc_buf *buf = buf_priv;
80 80
81 return &buf->paddr; 81 return &buf->dma_addr;
82} 82}
83 83
84static void *vb2_dma_contig_vaddr(void *buf_priv) 84static void *vb2_dma_contig_vaddr(void *buf_priv)
@@ -106,7 +106,7 @@ static int vb2_dma_contig_mmap(void *buf_priv, struct vm_area_struct *vma)
106 return -EINVAL; 106 return -EINVAL;
107 } 107 }
108 108
109 return vb2_mmap_pfn_range(vma, buf->paddr, buf->size, 109 return vb2_mmap_pfn_range(vma, buf->dma_addr, buf->size,
110 &vb2_common_vm_ops, &buf->handler); 110 &vb2_common_vm_ops, &buf->handler);
111} 111}
112 112
@@ -115,14 +115,14 @@ static void *vb2_dma_contig_get_userptr(void *alloc_ctx, unsigned long vaddr,
115{ 115{
116 struct vb2_dc_buf *buf; 116 struct vb2_dc_buf *buf;
117 struct vm_area_struct *vma; 117 struct vm_area_struct *vma;
118 dma_addr_t paddr = 0; 118 dma_addr_t dma_addr = 0;
119 int ret; 119 int ret;
120 120
121 buf = kzalloc(sizeof *buf, GFP_KERNEL); 121 buf = kzalloc(sizeof *buf, GFP_KERNEL);
122 if (!buf) 122 if (!buf)
123 return ERR_PTR(-ENOMEM); 123 return ERR_PTR(-ENOMEM);
124 124
125 ret = vb2_get_contig_userptr(vaddr, size, &vma, &paddr); 125 ret = vb2_get_contig_userptr(vaddr, size, &vma, &dma_addr);
126 if (ret) { 126 if (ret) {
127 printk(KERN_ERR "Failed acquiring VMA for vaddr 0x%08lx\n", 127 printk(KERN_ERR "Failed acquiring VMA for vaddr 0x%08lx\n",
128 vaddr); 128 vaddr);
@@ -131,7 +131,7 @@ static void *vb2_dma_contig_get_userptr(void *alloc_ctx, unsigned long vaddr,
131 } 131 }
132 132
133 buf->size = size; 133 buf->size = size;
134 buf->paddr = paddr; 134 buf->dma_addr = dma_addr;
135 buf->vma = vma; 135 buf->vma = vma;
136 136
137 return buf; 137 return buf;