diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-05-11 09:36:34 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 14:25:57 -0400 |
commit | bb6dbe74806a17bcec8396c57ca7fd9a889e3b27 (patch) | |
tree | 853278c1d41fbf81cde3e72599f7eade46901276 | |
parent | 959794ddc05ab6fbcd458bc093e7f0b92633d052 (diff) |
V4L/DVB: videobuf: Rename vmalloc fields to vaddr
The videobuf_dmabuf and videobuf_vmalloc_memory fields have a vmalloc
field to store the kernel virtual address of vmalloc'ed buffers. Rename
the field to vaddr.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/cx88/cx88-alsa.c | 2 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-alsa.c | 2 | ||||
-rw-r--r-- | drivers/media/video/videobuf-dma-sg.c | 18 | ||||
-rw-r--r-- | drivers/media/video/videobuf-vmalloc.c | 30 | ||||
-rw-r--r-- | drivers/staging/cx25821/cx25821-alsa.c | 2 | ||||
-rw-r--r-- | include/media/videobuf-dma-sg.h | 2 | ||||
-rw-r--r-- | include/media/videobuf-vmalloc.h | 2 |
7 files changed, 29 insertions, 29 deletions
diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c index ba499d04de4d..9209d5b87e04 100644 --- a/drivers/media/video/cx88/cx88-alsa.c +++ b/drivers/media/video/cx88/cx88-alsa.c | |||
@@ -426,7 +426,7 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream, | |||
426 | chip->buf = buf; | 426 | chip->buf = buf; |
427 | chip->dma_risc = dma; | 427 | chip->dma_risc = dma; |
428 | 428 | ||
429 | substream->runtime->dma_area = chip->dma_risc->vmalloc; | 429 | substream->runtime->dma_area = chip->dma_risc->vaddr; |
430 | substream->runtime->dma_bytes = chip->dma_size; | 430 | substream->runtime->dma_bytes = chip->dma_size; |
431 | substream->runtime->dma_addr = 0; | 431 | substream->runtime->dma_addr = 0; |
432 | return 0; | 432 | return 0; |
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index 5bca2abb31e6..68b7e8d10ded 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c | |||
@@ -669,7 +669,7 @@ static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream, | |||
669 | byte, but it doesn't work. So I allocate the DMA using the | 669 | byte, but it doesn't work. So I allocate the DMA using the |
670 | V4L functions, and force ALSA to use that as the DMA area */ | 670 | V4L functions, and force ALSA to use that as the DMA area */ |
671 | 671 | ||
672 | substream->runtime->dma_area = dev->dmasound.dma.vmalloc; | 672 | substream->runtime->dma_area = dev->dmasound.dma.vaddr; |
673 | substream->runtime->dma_bytes = dev->dmasound.bufsize; | 673 | substream->runtime->dma_bytes = dev->dmasound.bufsize; |
674 | substream->runtime->dma_addr = 0; | 674 | substream->runtime->dma_addr = 0; |
675 | 675 | ||
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c index 2d64040594b8..06f9a9c2a39a 100644 --- a/drivers/media/video/videobuf-dma-sg.c +++ b/drivers/media/video/videobuf-dma-sg.c | |||
@@ -211,17 +211,17 @@ int videobuf_dma_init_kernel(struct videobuf_dmabuf *dma, int direction, | |||
211 | dprintk(1, "init kernel [%d pages]\n", nr_pages); | 211 | dprintk(1, "init kernel [%d pages]\n", nr_pages); |
212 | 212 | ||
213 | dma->direction = direction; | 213 | dma->direction = direction; |
214 | dma->vmalloc = vmalloc_32(nr_pages << PAGE_SHIFT); | 214 | dma->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); |
215 | if (NULL == dma->vmalloc) { | 215 | if (NULL == dma->vaddr) { |
216 | dprintk(1, "vmalloc_32(%d pages) failed\n", nr_pages); | 216 | dprintk(1, "vmalloc_32(%d pages) failed\n", nr_pages); |
217 | return -ENOMEM; | 217 | return -ENOMEM; |
218 | } | 218 | } |
219 | 219 | ||
220 | dprintk(1, "vmalloc is at addr 0x%08lx, size=%d\n", | 220 | dprintk(1, "vmalloc is at addr 0x%08lx, size=%d\n", |
221 | (unsigned long)dma->vmalloc, | 221 | (unsigned long)dma->vaddr, |
222 | nr_pages << PAGE_SHIFT); | 222 | nr_pages << PAGE_SHIFT); |
223 | 223 | ||
224 | memset(dma->vmalloc, 0, nr_pages << PAGE_SHIFT); | 224 | memset(dma->vaddr, 0, nr_pages << PAGE_SHIFT); |
225 | dma->nr_pages = nr_pages; | 225 | dma->nr_pages = nr_pages; |
226 | 226 | ||
227 | return 0; | 227 | return 0; |
@@ -254,8 +254,8 @@ int videobuf_dma_map(struct device *dev, struct videobuf_dmabuf *dma) | |||
254 | dma->sglist = videobuf_pages_to_sg(dma->pages, dma->nr_pages, | 254 | dma->sglist = videobuf_pages_to_sg(dma->pages, dma->nr_pages, |
255 | dma->offset); | 255 | dma->offset); |
256 | } | 256 | } |
257 | if (dma->vmalloc) { | 257 | if (dma->vaddr) { |
258 | dma->sglist = videobuf_vmalloc_to_sg(dma->vmalloc, | 258 | dma->sglist = videobuf_vmalloc_to_sg(dma->vaddr, |
259 | dma->nr_pages); | 259 | dma->nr_pages); |
260 | } | 260 | } |
261 | if (dma->bus_addr) { | 261 | if (dma->bus_addr) { |
@@ -319,8 +319,8 @@ int videobuf_dma_free(struct videobuf_dmabuf *dma) | |||
319 | dma->pages = NULL; | 319 | dma->pages = NULL; |
320 | } | 320 | } |
321 | 321 | ||
322 | vfree(dma->vmalloc); | 322 | vfree(dma->vaddr); |
323 | dma->vmalloc = NULL; | 323 | dma->vaddr = NULL; |
324 | 324 | ||
325 | if (dma->bus_addr) | 325 | if (dma->bus_addr) |
326 | dma->bus_addr = 0; | 326 | dma->bus_addr = 0; |
@@ -444,7 +444,7 @@ static void *__videobuf_to_vaddr(struct videobuf_buffer *buf) | |||
444 | 444 | ||
445 | MAGIC_CHECK(mem->magic, MAGIC_SG_MEM); | 445 | MAGIC_CHECK(mem->magic, MAGIC_SG_MEM); |
446 | 446 | ||
447 | return mem->dma.vmalloc; | 447 | return mem->dma.vaddr; |
448 | } | 448 | } |
449 | 449 | ||
450 | static int __videobuf_iolock(struct videobuf_queue *q, | 450 | static int __videobuf_iolock(struct videobuf_queue *q, |
diff --git a/drivers/media/video/videobuf-vmalloc.c b/drivers/media/video/videobuf-vmalloc.c index f0d7cb8d4c72..e7fe31d54f07 100644 --- a/drivers/media/video/videobuf-vmalloc.c +++ b/drivers/media/video/videobuf-vmalloc.c | |||
@@ -102,10 +102,10 @@ static void videobuf_vm_close(struct vm_area_struct *vma) | |||
102 | called with IRQ's disabled | 102 | called with IRQ's disabled |
103 | */ | 103 | */ |
104 | dprintk(1, "%s: buf[%d] freeing (%p)\n", | 104 | dprintk(1, "%s: buf[%d] freeing (%p)\n", |
105 | __func__, i, mem->vmalloc); | 105 | __func__, i, mem->vaddr); |
106 | 106 | ||
107 | vfree(mem->vmalloc); | 107 | vfree(mem->vaddr); |
108 | mem->vmalloc = NULL; | 108 | mem->vaddr = NULL; |
109 | } | 109 | } |
110 | 110 | ||
111 | q->bufs[i]->map = NULL; | 111 | q->bufs[i]->map = NULL; |
@@ -170,7 +170,7 @@ static int __videobuf_iolock(struct videobuf_queue *q, | |||
170 | dprintk(1, "%s memory method MMAP\n", __func__); | 170 | dprintk(1, "%s memory method MMAP\n", __func__); |
171 | 171 | ||
172 | /* All handling should be done by __videobuf_mmap_mapper() */ | 172 | /* All handling should be done by __videobuf_mmap_mapper() */ |
173 | if (!mem->vmalloc) { | 173 | if (!mem->vaddr) { |
174 | printk(KERN_ERR "memory is not alloced/mmapped.\n"); | 174 | printk(KERN_ERR "memory is not alloced/mmapped.\n"); |
175 | return -EINVAL; | 175 | return -EINVAL; |
176 | } | 176 | } |
@@ -189,13 +189,13 @@ static int __videobuf_iolock(struct videobuf_queue *q, | |||
189 | * read() method. | 189 | * read() method. |
190 | */ | 190 | */ |
191 | 191 | ||
192 | mem->vmalloc = vmalloc_user(pages); | 192 | mem->vaddr = vmalloc_user(pages); |
193 | if (!mem->vmalloc) { | 193 | if (!mem->vaddr) { |
194 | printk(KERN_ERR "vmalloc (%d pages) failed\n", pages); | 194 | printk(KERN_ERR "vmalloc (%d pages) failed\n", pages); |
195 | return -ENOMEM; | 195 | return -ENOMEM; |
196 | } | 196 | } |
197 | dprintk(1, "vmalloc is at addr %p (%d pages)\n", | 197 | dprintk(1, "vmalloc is at addr %p (%d pages)\n", |
198 | mem->vmalloc, pages); | 198 | mem->vaddr, pages); |
199 | 199 | ||
200 | #if 0 | 200 | #if 0 |
201 | int rc; | 201 | int rc; |
@@ -254,18 +254,18 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q, | |||
254 | MAGIC_CHECK(mem->magic, MAGIC_VMAL_MEM); | 254 | MAGIC_CHECK(mem->magic, MAGIC_VMAL_MEM); |
255 | 255 | ||
256 | pages = PAGE_ALIGN(vma->vm_end - vma->vm_start); | 256 | pages = PAGE_ALIGN(vma->vm_end - vma->vm_start); |
257 | mem->vmalloc = vmalloc_user(pages); | 257 | mem->vaddr = vmalloc_user(pages); |
258 | if (!mem->vmalloc) { | 258 | if (!mem->vaddr) { |
259 | printk(KERN_ERR "vmalloc (%d pages) failed\n", pages); | 259 | printk(KERN_ERR "vmalloc (%d pages) failed\n", pages); |
260 | goto error; | 260 | goto error; |
261 | } | 261 | } |
262 | dprintk(1, "vmalloc is at addr %p (%d pages)\n", mem->vmalloc, pages); | 262 | dprintk(1, "vmalloc is at addr %p (%d pages)\n", mem->vaddr, pages); |
263 | 263 | ||
264 | /* Try to remap memory */ | 264 | /* Try to remap memory */ |
265 | retval = remap_vmalloc_range(vma, mem->vmalloc, 0); | 265 | retval = remap_vmalloc_range(vma, mem->vaddr, 0); |
266 | if (retval < 0) { | 266 | if (retval < 0) { |
267 | printk(KERN_ERR "mmap: remap failed with error %d. ", retval); | 267 | printk(KERN_ERR "mmap: remap failed with error %d. ", retval); |
268 | vfree(mem->vmalloc); | 268 | vfree(mem->vaddr); |
269 | goto error; | 269 | goto error; |
270 | } | 270 | } |
271 | 271 | ||
@@ -317,7 +317,7 @@ void *videobuf_to_vmalloc(struct videobuf_buffer *buf) | |||
317 | BUG_ON(!mem); | 317 | BUG_ON(!mem); |
318 | MAGIC_CHECK(mem->magic, MAGIC_VMAL_MEM); | 318 | MAGIC_CHECK(mem->magic, MAGIC_VMAL_MEM); |
319 | 319 | ||
320 | return mem->vmalloc; | 320 | return mem->vaddr; |
321 | } | 321 | } |
322 | EXPORT_SYMBOL_GPL(videobuf_to_vmalloc); | 322 | EXPORT_SYMBOL_GPL(videobuf_to_vmalloc); |
323 | 323 | ||
@@ -339,8 +339,8 @@ void videobuf_vmalloc_free(struct videobuf_buffer *buf) | |||
339 | 339 | ||
340 | MAGIC_CHECK(mem->magic, MAGIC_VMAL_MEM); | 340 | MAGIC_CHECK(mem->magic, MAGIC_VMAL_MEM); |
341 | 341 | ||
342 | vfree(mem->vmalloc); | 342 | vfree(mem->vaddr); |
343 | mem->vmalloc = NULL; | 343 | mem->vaddr = NULL; |
344 | 344 | ||
345 | return; | 345 | return; |
346 | } | 346 | } |
diff --git a/drivers/staging/cx25821/cx25821-alsa.c b/drivers/staging/cx25821/cx25821-alsa.c index 0771a6a313ad..a43b18816fa5 100644 --- a/drivers/staging/cx25821/cx25821-alsa.c +++ b/drivers/staging/cx25821/cx25821-alsa.c | |||
@@ -492,7 +492,7 @@ static int snd_cx25821_hw_params(struct snd_pcm_substream *substream, | |||
492 | chip->buf = buf; | 492 | chip->buf = buf; |
493 | chip->dma_risc = dma; | 493 | chip->dma_risc = dma; |
494 | 494 | ||
495 | substream->runtime->dma_area = chip->dma_risc->vmalloc; | 495 | substream->runtime->dma_area = chip->dma_risc->vaddr; |
496 | substream->runtime->dma_bytes = chip->dma_size; | 496 | substream->runtime->dma_bytes = chip->dma_size; |
497 | substream->runtime->dma_addr = 0; | 497 | substream->runtime->dma_addr = 0; |
498 | 498 | ||
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h index 913860e9c845..97e07f46a0fa 100644 --- a/include/media/videobuf-dma-sg.h +++ b/include/media/videobuf-dma-sg.h | |||
@@ -51,7 +51,7 @@ struct videobuf_dmabuf { | |||
51 | struct page **pages; | 51 | struct page **pages; |
52 | 52 | ||
53 | /* for kernel buffers */ | 53 | /* for kernel buffers */ |
54 | void *vmalloc; | 54 | void *vaddr; |
55 | 55 | ||
56 | /* for overlay buffers (pci-pci dma) */ | 56 | /* for overlay buffers (pci-pci dma) */ |
57 | dma_addr_t bus_addr; | 57 | dma_addr_t bus_addr; |
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h index 851eb1a2ff2a..e19403c18dae 100644 --- a/include/media/videobuf-vmalloc.h +++ b/include/media/videobuf-vmalloc.h | |||
@@ -22,7 +22,7 @@ | |||
22 | struct videobuf_vmalloc_memory { | 22 | struct videobuf_vmalloc_memory { |
23 | u32 magic; | 23 | u32 magic; |
24 | 24 | ||
25 | void *vmalloc; | 25 | void *vaddr; |
26 | 26 | ||
27 | /* remap_vmalloc_range seems to need to run | 27 | /* remap_vmalloc_range seems to need to run |
28 | * after mmap() on some cases */ | 28 | * after mmap() on some cases */ |