Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330697
b: refs/heads/master
c: 28c3682
h: refs/heads/master
i:
  330695: 20da1ed
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Aug 9, 2012
1 parent 38650fd commit ad3be7d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f135a8a224294fa0f60ec1b8bc120813b7cfc804
refs/heads/master: 28c3682ac59dcc551682eceb021b66386ee4e570
17 changes: 11 additions & 6 deletions trunk/drivers/media/video/blackfin/bfin_capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,13 @@ static int bcap_release(struct file *file)
static int bcap_mmap(struct file *file, struct vm_area_struct *vma)
{
struct bcap_device *bcap_dev = video_drvdata(file);
int ret;

return vb2_mmap(&bcap_dev->buffer_queue, vma);
if (mutex_lock_interruptible(&bcap_dev->mutex))
return -ERESTARTSYS;
ret = vb2_mmap(&bcap_dev->buffer_queue, vma);
mutex_unlock(&bcap_dev->mutex);
return ret;
}

#ifndef CONFIG_MMU
Expand All @@ -259,8 +264,12 @@ static unsigned long bcap_get_unmapped_area(struct file *file,
static unsigned int bcap_poll(struct file *file, poll_table *wait)
{
struct bcap_device *bcap_dev = video_drvdata(file);
unsigned int res;

return vb2_poll(&bcap_dev->buffer_queue, file, wait);
mutex_lock(&bcap_dev->mutex);
res = vb2_poll(&bcap_dev->buffer_queue, file, wait);
mutex_unlock(&bcap_dev->mutex);
return res;
}

static int bcap_queue_setup(struct vb2_queue *vq,
Expand Down Expand Up @@ -942,10 +951,6 @@ static int __devinit bcap_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&bcap_dev->dma_queue);

vfd->lock = &bcap_dev->mutex;
/* Locking in file operations other than ioctl should be done
by the driver, not the V4L2 core.
This driver needs auditing so that this flag can be removed. */
set_bit(V4L2_FL_LOCK_ALL_FOPS, &vfd->flags);

/* register video device */
ret = video_register_device(bcap_dev->video_dev, VFL_TYPE_GRABBER, -1);
Expand Down

0 comments on commit ad3be7d

Please sign in to comment.