aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/zoran/zoran_driver.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c
index 7129f9254e70..07f2bdfef4ee 100644
--- a/drivers/media/video/zoran/zoran_driver.c
+++ b/drivers/media/video/zoran/zoran_driver.c
@@ -2493,6 +2493,8 @@ static int zoran_overlay(struct file *file, void *__fh, unsigned int on)
2493 return res; 2493 return res;
2494} 2494}
2495 2495
2496static int zoran_streamoff(struct file *file, void *__fh, enum v4l2_buf_type type);
2497
2496static int zoran_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffers *req) 2498static int zoran_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffers *req)
2497{ 2499{
2498 struct zoran_fh *fh = __fh; 2500 struct zoran_fh *fh = __fh;
@@ -2500,17 +2502,19 @@ static int zoran_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffe
2500 int res = 0; 2502 int res = 0;
2501 2503
2502 if (req->memory != V4L2_MEMORY_MMAP) { 2504 if (req->memory != V4L2_MEMORY_MMAP) {
2503 dprintk(1, 2505 dprintk(2,
2504 KERN_ERR 2506 KERN_ERR
2505 "%s: only MEMORY_MMAP capture is supported, not %d\n", 2507 "%s: only MEMORY_MMAP capture is supported, not %d\n",
2506 ZR_DEVNAME(zr), req->memory); 2508 ZR_DEVNAME(zr), req->memory);
2507 return -EINVAL; 2509 return -EINVAL;
2508 } 2510 }
2509 2511
2510 mutex_lock(&zr->resource_lock); 2512 if (req->count == 0)
2513 return zoran_streamoff(file, fh, req->type);
2511 2514
2515 mutex_lock(&zr->resource_lock);
2512 if (fh->v4l_buffers.allocated || fh->jpg_buffers.allocated) { 2516 if (fh->v4l_buffers.allocated || fh->jpg_buffers.allocated) {
2513 dprintk(1, 2517 dprintk(2,
2514 KERN_ERR 2518 KERN_ERR
2515 "%s: VIDIOC_REQBUFS - buffers already allocated\n", 2519 "%s: VIDIOC_REQBUFS - buffers already allocated\n",
2516 ZR_DEVNAME(zr)); 2520 ZR_DEVNAME(zr));