Commit bb6dbe74806a17bcec8396c57ca7fd9a889e3b27

Authored by Laurent Pinchart
Committed by Mauro Carvalho Chehab
1 parent 959794ddc0

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>

Showing 7 changed files with 29 additions and 29 deletions Side-by-side Diff

drivers/media/video/cx88/cx88-alsa.c
... ... @@ -426,7 +426,7 @@
426 426 chip->buf = buf;
427 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 430 substream->runtime->dma_bytes = chip->dma_size;
431 431 substream->runtime->dma_addr = 0;
432 432 return 0;
drivers/media/video/saa7134/saa7134-alsa.c
... ... @@ -669,7 +669,7 @@
669 669 byte, but it doesn't work. So I allocate the DMA using the
670 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 673 substream->runtime->dma_bytes = dev->dmasound.bufsize;
674 674 substream->runtime->dma_addr = 0;
675 675  
drivers/media/video/videobuf-dma-sg.c
... ... @@ -211,17 +211,17 @@
211 211 dprintk(1, "init kernel [%d pages]\n", nr_pages);
212 212  
213 213 dma->direction = direction;
214   - dma->vmalloc = vmalloc_32(nr_pages << PAGE_SHIFT);
215   - if (NULL == dma->vmalloc) {
  214 + dma->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT);
  215 + if (NULL == dma->vaddr) {
216 216 dprintk(1, "vmalloc_32(%d pages) failed\n", nr_pages);
217 217 return -ENOMEM;
218 218 }
219 219  
220 220 dprintk(1, "vmalloc is at addr 0x%08lx, size=%d\n",
221   - (unsigned long)dma->vmalloc,
  221 + (unsigned long)dma->vaddr,
222 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 225 dma->nr_pages = nr_pages;
226 226  
227 227 return 0;
... ... @@ -254,8 +254,8 @@
254 254 dma->sglist = videobuf_pages_to_sg(dma->pages, dma->nr_pages,
255 255 dma->offset);
256 256 }
257   - if (dma->vmalloc) {
258   - dma->sglist = videobuf_vmalloc_to_sg(dma->vmalloc,
  257 + if (dma->vaddr) {
  258 + dma->sglist = videobuf_vmalloc_to_sg(dma->vaddr,
259 259 dma->nr_pages);
260 260 }
261 261 if (dma->bus_addr) {
... ... @@ -319,8 +319,8 @@
319 319 dma->pages = NULL;
320 320 }
321 321  
322   - vfree(dma->vmalloc);
323   - dma->vmalloc = NULL;
  322 + vfree(dma->vaddr);
  323 + dma->vaddr = NULL;
324 324  
325 325 if (dma->bus_addr)
326 326 dma->bus_addr = 0;
... ... @@ -444,7 +444,7 @@
444 444  
445 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 450 static int __videobuf_iolock(struct videobuf_queue *q,
drivers/media/video/videobuf-vmalloc.c
... ... @@ -102,10 +102,10 @@
102 102 called with IRQ's disabled
103 103 */
104 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);
108   - mem->vmalloc = NULL;
  107 + vfree(mem->vaddr);
  108 + mem->vaddr = NULL;
109 109 }
110 110  
111 111 q->bufs[i]->map = NULL;
... ... @@ -170,7 +170,7 @@
170 170 dprintk(1, "%s memory method MMAP\n", __func__);
171 171  
172 172 /* All handling should be done by __videobuf_mmap_mapper() */
173   - if (!mem->vmalloc) {
  173 + if (!mem->vaddr) {
174 174 printk(KERN_ERR "memory is not alloced/mmapped.\n");
175 175 return -EINVAL;
176 176 }
177 177  
... ... @@ -189,13 +189,13 @@
189 189 * read() method.
190 190 */
191 191  
192   - mem->vmalloc = vmalloc_user(pages);
193   - if (!mem->vmalloc) {
  192 + mem->vaddr = vmalloc_user(pages);
  193 + if (!mem->vaddr) {
194 194 printk(KERN_ERR "vmalloc (%d pages) failed\n", pages);
195 195 return -ENOMEM;
196 196 }
197 197 dprintk(1, "vmalloc is at addr %p (%d pages)\n",
198   - mem->vmalloc, pages);
  198 + mem->vaddr, pages);
199 199  
200 200 #if 0
201 201 int rc;
202 202  
203 203  
204 204  
... ... @@ -254,18 +254,18 @@
254 254 MAGIC_CHECK(mem->magic, MAGIC_VMAL_MEM);
255 255  
256 256 pages = PAGE_ALIGN(vma->vm_end - vma->vm_start);
257   - mem->vmalloc = vmalloc_user(pages);
258   - if (!mem->vmalloc) {
  257 + mem->vaddr = vmalloc_user(pages);
  258 + if (!mem->vaddr) {
259 259 printk(KERN_ERR "vmalloc (%d pages) failed\n", pages);
260 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 264 /* Try to remap memory */
265   - retval = remap_vmalloc_range(vma, mem->vmalloc, 0);
  265 + retval = remap_vmalloc_range(vma, mem->vaddr, 0);
266 266 if (retval < 0) {
267 267 printk(KERN_ERR "mmap: remap failed with error %d. ", retval);
268   - vfree(mem->vmalloc);
  268 + vfree(mem->vaddr);
269 269 goto error;
270 270 }
271 271  
... ... @@ -317,7 +317,7 @@
317 317 BUG_ON(!mem);
318 318 MAGIC_CHECK(mem->magic, MAGIC_VMAL_MEM);
319 319  
320   - return mem->vmalloc;
  320 + return mem->vaddr;
321 321 }
322 322 EXPORT_SYMBOL_GPL(videobuf_to_vmalloc);
323 323  
... ... @@ -339,8 +339,8 @@
339 339  
340 340 MAGIC_CHECK(mem->magic, MAGIC_VMAL_MEM);
341 341  
342   - vfree(mem->vmalloc);
343   - mem->vmalloc = NULL;
  342 + vfree(mem->vaddr);
  343 + mem->vaddr = NULL;
344 344  
345 345 return;
346 346 }
drivers/staging/cx25821/cx25821-alsa.c
... ... @@ -492,7 +492,7 @@
492 492 chip->buf = buf;
493 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 496 substream->runtime->dma_bytes = chip->dma_size;
497 497 substream->runtime->dma_addr = 0;
498 498  
include/media/videobuf-dma-sg.h
... ... @@ -51,7 +51,7 @@
51 51 struct page **pages;
52 52  
53 53 /* for kernel buffers */
54   - void *vmalloc;
  54 + void *vaddr;
55 55  
56 56 /* for overlay buffers (pci-pci dma) */
57 57 dma_addr_t bus_addr;
include/media/videobuf-vmalloc.h
... ... @@ -22,7 +22,7 @@
22 22 struct videobuf_vmalloc_memory {
23 23 u32 magic;
24 24  
25   - void *vmalloc;
  25 + void *vaddr;
26 26  
27 27 /* remap_vmalloc_range seems to need to run
28 28 * after mmap() on some cases */