aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/videobuf-vmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/videobuf-vmalloc.c')
-rw-r--r--drivers/media/video/videobuf-vmalloc.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/media/video/videobuf-vmalloc.c b/drivers/media/video/videobuf-vmalloc.c
index 9b3898347ca5..5266ecc91dab 100644
--- a/drivers/media/video/videobuf-vmalloc.c
+++ b/drivers/media/video/videobuf-vmalloc.c
@@ -70,7 +70,7 @@ videobuf_vm_close(struct vm_area_struct *vma)
70 map->count--; 70 map->count--;
71 if (0 == map->count) { 71 if (0 == map->count) {
72 dprintk(1,"munmap %p q=%p\n",map,q); 72 dprintk(1,"munmap %p q=%p\n",map,q);
73 mutex_lock(&q->lock); 73 mutex_lock(&q->vb_lock);
74 for (i = 0; i < VIDEO_MAX_FRAME; i++) { 74 for (i = 0; i < VIDEO_MAX_FRAME; i++) {
75 if (NULL == q->bufs[i]) 75 if (NULL == q->bufs[i])
76 continue; 76 continue;
@@ -83,7 +83,7 @@ videobuf_vm_close(struct vm_area_struct *vma)
83 q->bufs[i]->map = NULL; 83 q->bufs[i]->map = NULL;
84 q->bufs[i]->baddr = 0; 84 q->bufs[i]->baddr = 0;
85 } 85 }
86 mutex_unlock(&q->lock); 86 mutex_unlock(&q->vb_lock);
87 kfree(map); 87 kfree(map);
88 } 88 }
89 return; 89 return;
@@ -107,7 +107,7 @@ static struct vm_operations_struct videobuf_vm_ops =
107 107
108static void *__videobuf_alloc(size_t size) 108static void *__videobuf_alloc(size_t size)
109{ 109{
110 struct videbuf_vmalloc_memory *mem; 110 struct videobuf_vmalloc_memory *mem;
111 struct videobuf_buffer *vb; 111 struct videobuf_buffer *vb;
112 112
113 vb = kzalloc(size+sizeof(*mem),GFP_KERNEL); 113 vb = kzalloc(size+sizeof(*mem),GFP_KERNEL);
@@ -127,9 +127,7 @@ static int __videobuf_iolock (struct videobuf_queue* q,
127 struct v4l2_framebuffer *fbuf) 127 struct v4l2_framebuffer *fbuf)
128{ 128{
129 int pages; 129 int pages;
130 130 struct videobuf_vmalloc_memory *mem=vb->priv;
131 struct videbuf_vmalloc_memory *mem=vb->priv;
132
133 131
134 BUG_ON(!mem); 132 BUG_ON(!mem);
135 133
@@ -195,7 +193,7 @@ static int __videobuf_mmap_free(struct videobuf_queue *q)
195static int __videobuf_mmap_mapper(struct videobuf_queue *q, 193static int __videobuf_mmap_mapper(struct videobuf_queue *q,
196 struct vm_area_struct *vma) 194 struct vm_area_struct *vma)
197{ 195{
198 struct videbuf_vmalloc_memory *mem; 196 struct videobuf_vmalloc_memory *mem;
199 struct videobuf_mapping *map; 197 struct videobuf_mapping *map;
200 unsigned int first; 198 unsigned int first;
201 int retval; 199 int retval;
@@ -267,7 +265,7 @@ static int __videobuf_copy_to_user ( struct videobuf_queue *q,
267 char __user *data, size_t count, 265 char __user *data, size_t count,
268 int nonblocking ) 266 int nonblocking )
269{ 267{
270 struct videbuf_vmalloc_memory *mem=q->read_buf->priv; 268 struct videobuf_vmalloc_memory *mem=q->read_buf->priv;
271 BUG_ON (!mem); 269 BUG_ON (!mem);
272 MAGIC_CHECK(mem->magic,MAGIC_VMAL_MEM); 270 MAGIC_CHECK(mem->magic,MAGIC_VMAL_MEM);
273 271
@@ -288,7 +286,7 @@ static int __videobuf_copy_stream ( struct videobuf_queue *q,
288 int vbihack, int nonblocking ) 286 int vbihack, int nonblocking )
289{ 287{
290 unsigned int *fc; 288 unsigned int *fc;
291 struct videbuf_vmalloc_memory *mem=q->read_buf->priv; 289 struct videobuf_vmalloc_memory *mem=q->read_buf->priv;
292 BUG_ON (!mem); 290 BUG_ON (!mem);
293 MAGIC_CHECK(mem->magic,MAGIC_VMAL_MEM); 291 MAGIC_CHECK(mem->magic,MAGIC_VMAL_MEM);
294 292
@@ -341,7 +339,7 @@ EXPORT_SYMBOL_GPL(videobuf_queue_vmalloc_init);
341 339
342void *videobuf_to_vmalloc (struct videobuf_buffer *buf) 340void *videobuf_to_vmalloc (struct videobuf_buffer *buf)
343{ 341{
344 struct videbuf_vmalloc_memory *mem=buf->priv; 342 struct videobuf_vmalloc_memory *mem=buf->priv;
345 BUG_ON (!mem); 343 BUG_ON (!mem);
346 MAGIC_CHECK(mem->magic,MAGIC_VMAL_MEM); 344 MAGIC_CHECK(mem->magic,MAGIC_VMAL_MEM);
347 345
@@ -351,7 +349,7 @@ EXPORT_SYMBOL_GPL(videobuf_to_vmalloc);
351 349
352void videobuf_vmalloc_free (struct videobuf_buffer *buf) 350void videobuf_vmalloc_free (struct videobuf_buffer *buf)
353{ 351{
354 struct videbuf_vmalloc_memory *mem=buf->priv; 352 struct videobuf_vmalloc_memory *mem=buf->priv;
355 BUG_ON (!mem); 353 BUG_ON (!mem);
356 354
357 MAGIC_CHECK(mem->magic,MAGIC_VMAL_MEM); 355 MAGIC_CHECK(mem->magic,MAGIC_VMAL_MEM);