diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2015-03-08 11:40:42 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-02 18:11:23 -0300 |
commit | 8fd05b7eee4b5a8653751cab90b3d1aa7901ccf7 (patch) | |
tree | 36d7a124f82131dc78dbd5c986fc90ac1e9aaee0 /drivers/media/platform/blackfin | |
parent | f314002279a4984cca86b5fa3920b6c84171beab (diff) | |
download | talos-obmc-linux-8fd05b7eee4b5a8653751cab90b3d1aa7901ccf7.tar.gz talos-obmc-linux-8fd05b7eee4b5a8653751cab90b3d1aa7901ccf7.zip |
[media] media: blackfin: bfin_capture: use vb2_fop_mmap/poll
No need to reinvent the wheel. Just use the already existing
functions provided by vb2.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/blackfin')
-rw-r--r-- | drivers/media/platform/blackfin/bfin_capture.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c index bf7e9997b794..84827d204333 100644 --- a/drivers/media/platform/blackfin/bfin_capture.c +++ b/drivers/media/platform/blackfin/bfin_capture.c @@ -244,18 +244,6 @@ static int bcap_release(struct file *file) return 0; } -static int bcap_mmap(struct file *file, struct vm_area_struct *vma) -{ - struct bcap_device *bcap_dev = video_drvdata(file); - int ret; - - 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 static unsigned long bcap_get_unmapped_area(struct file *file, unsigned long addr, @@ -273,17 +261,6 @@ static unsigned long bcap_get_unmapped_area(struct file *file, } #endif -static unsigned int bcap_poll(struct file *file, poll_table *wait) -{ - struct bcap_device *bcap_dev = video_drvdata(file); - unsigned int res; - - 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, const struct v4l2_format *fmt, unsigned int *nbuffers, unsigned int *nplanes, @@ -900,11 +877,11 @@ static struct v4l2_file_operations bcap_fops = { .open = bcap_open, .release = bcap_release, .unlocked_ioctl = video_ioctl2, - .mmap = bcap_mmap, + .mmap = vb2_fop_mmap, #ifndef CONFIG_MMU .get_unmapped_area = bcap_get_unmapped_area, #endif - .poll = bcap_poll + .poll = vb2_fop_poll }; static int bcap_probe(struct platform_device *pdev) @@ -1001,6 +978,7 @@ static int bcap_probe(struct platform_device *pdev) INIT_LIST_HEAD(&bcap_dev->dma_queue); vfd->lock = &bcap_dev->mutex; + vfd->queue = q; /* register video device */ ret = video_register_device(bcap_dev->video_dev, VFL_TYPE_GRABBER, -1); |