aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-04-17 01:47:21 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-04-23 09:12:51 -0400
commite37559b22c63b557d242bfa1a07ab1b8f7d5d9f1 (patch)
treec74ed6e62e384350c04c35bfdc7fdf34c82fcdb3
parentac9687a2e6abd7d87af413d1a8eb78f947921464 (diff)
[media] vb2: stop_streaming should return void
The vb2 core ignores any return code from the stop_streaming op. And there really isn't anything it can do anyway in case of an error. So change the return type to void and update any drivers that implement it. The int return gave drivers the idea that this operation could actually fail, but that's really not the case. The pwc amd sdr-msi3101 drivers both had this construction: if (mutex_lock_interruptible(&s->v4l2_lock)) return -ERESTARTSYS; This has been updated to just call mutex_lock(). The stop_streaming op expects this to really stop streaming and I very much doubt this will work reliably if stop_streaming just returns without really stopping the DMA. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--Documentation/video4linux/v4l2-pci-skeleton.c3
-rw-r--r--drivers/media/pci/sta2x11/sta2x11_vip.c3
-rw-r--r--drivers/media/platform/blackfin/bfin_capture.c3
-rw-r--r--drivers/media/platform/coda.c4
-rw-r--r--drivers/media/platform/davinci/vpbe_display.c5
-rw-r--r--drivers/media/platform/davinci/vpif_capture.c6
-rw-r--r--drivers/media/platform/davinci/vpif_display.c6
-rw-r--r--drivers/media/platform/exynos-gsc/gsc-m2m.c4
-rw-r--r--drivers/media/platform/exynos4-is/fimc-capture.c6
-rw-r--r--drivers/media/platform/exynos4-is/fimc-isp-video.c5
-rw-r--r--drivers/media/platform/exynos4-is/fimc-lite.c6
-rw-r--r--drivers/media/platform/exynos4-is/fimc-m2m.c3
-rw-r--r--drivers/media/platform/marvell-ccic/mcam-core.c7
-rw-r--r--drivers/media/platform/mem2mem_testdev.c5
-rw-r--r--drivers/media/platform/s3c-camif/camif-capture.c4
-rw-r--r--drivers/media/platform/s5p-jpeg/jpeg-core.c4
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_dec.c3
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_enc.c3
-rw-r--r--drivers/media/platform/s5p-tv/mixer_video.c3
-rw-r--r--drivers/media/platform/soc_camera/atmel-isi.c6
-rw-r--r--drivers/media/platform/soc_camera/mx2_camera.c4
-rw-r--r--drivers/media/platform/soc_camera/mx3_camera.c4
-rw-r--r--drivers/media/platform/soc_camera/rcar_vin.c4
-rw-r--r--drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c4
-rw-r--r--drivers/media/platform/vivi.c3
-rw-r--r--drivers/media/platform/vsp1/vsp1_video.c4
-rw-r--r--drivers/media/usb/em28xx/em28xx-v4l.h2
-rw-r--r--drivers/media/usb/em28xx/em28xx-video.c8
-rw-r--r--drivers/media/usb/pwc/pwc-if.c7
-rw-r--r--drivers/media/usb/s2255/s2255drv.c5
-rw-r--r--drivers/media/usb/stk1160/stk1160-v4l.c4
-rw-r--r--drivers/media/usb/usbtv/usbtv-video.c9
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c2
-rw-r--r--drivers/staging/media/davinci_vpfe/vpfe_video.c3
-rw-r--r--drivers/staging/media/dt3155v4l/dt3155v4l.c3
-rw-r--r--drivers/staging/media/go7007/go7007-v4l2.c3
-rw-r--r--drivers/staging/media/msi3101/sdr-msi3101.c24
-rw-r--r--drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c7
-rw-r--r--drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c3
-rw-r--r--drivers/staging/media/solo6x10/solo6x10-v4l2.c3
-rw-r--r--include/media/videobuf2-core.h2
41 files changed, 69 insertions, 128 deletions
diff --git a/Documentation/video4linux/v4l2-pci-skeleton.c b/Documentation/video4linux/v4l2-pci-skeleton.c
index 80251dc2c6cf..53dd346586f6 100644
--- a/Documentation/video4linux/v4l2-pci-skeleton.c
+++ b/Documentation/video4linux/v4l2-pci-skeleton.c
@@ -269,7 +269,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
269 * Stop the DMA engine. Any remaining buffers in the DMA queue are dequeued 269 * Stop the DMA engine. Any remaining buffers in the DMA queue are dequeued
270 * and passed on to the vb2 framework marked as STATE_ERROR. 270 * and passed on to the vb2 framework marked as STATE_ERROR.
271 */ 271 */
272static int stop_streaming(struct vb2_queue *vq) 272static void stop_streaming(struct vb2_queue *vq)
273{ 273{
274 struct skeleton *skel = vb2_get_drv_priv(vq); 274 struct skeleton *skel = vb2_get_drv_priv(vq);
275 275
@@ -277,7 +277,6 @@ static int stop_streaming(struct vb2_queue *vq)
277 277
278 /* Release all active buffers */ 278 /* Release all active buffers */
279 return_all_buffers(skel, VB2_BUF_STATE_ERROR); 279 return_all_buffers(skel, VB2_BUF_STATE_ERROR);
280 return 0;
281} 280}
282 281
283/* 282/*
diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c
index bb11443ed63e..7559951b2ea4 100644
--- a/drivers/media/pci/sta2x11/sta2x11_vip.c
+++ b/drivers/media/pci/sta2x11/sta2x11_vip.c
@@ -357,7 +357,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
357} 357}
358 358
359/* abort streaming and wait for last buffer */ 359/* abort streaming and wait for last buffer */
360static int stop_streaming(struct vb2_queue *vq) 360static void stop_streaming(struct vb2_queue *vq)
361{ 361{
362 struct sta2x11_vip *vip = vb2_get_drv_priv(vq); 362 struct sta2x11_vip *vip = vb2_get_drv_priv(vq);
363 struct vip_buffer *vip_buf, *node; 363 struct vip_buffer *vip_buf, *node;
@@ -374,7 +374,6 @@ static int stop_streaming(struct vb2_queue *vq)
374 list_del(&vip_buf->list); 374 list_del(&vip_buf->list);
375 } 375 }
376 spin_unlock(&vip->lock); 376 spin_unlock(&vip->lock);
377 return 0;
378} 377}
379 378
380static struct vb2_ops vip_video_qops = { 379static struct vb2_ops vip_video_qops = {
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c
index 200bec91182e..dfb09d4ee6d1 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -427,7 +427,7 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
427 return 0; 427 return 0;
428} 428}
429 429
430static int bcap_stop_streaming(struct vb2_queue *vq) 430static void bcap_stop_streaming(struct vb2_queue *vq)
431{ 431{
432 struct bcap_device *bcap_dev = vb2_get_drv_priv(vq); 432 struct bcap_device *bcap_dev = vb2_get_drv_priv(vq);
433 struct ppi_if *ppi = bcap_dev->ppi; 433 struct ppi_if *ppi = bcap_dev->ppi;
@@ -452,7 +452,6 @@ static int bcap_stop_streaming(struct vb2_queue *vq)
452 list_del(&bcap_dev->cur_frm->list); 452 list_del(&bcap_dev->cur_frm->list);
453 vb2_buffer_done(&bcap_dev->cur_frm->vb, VB2_BUF_STATE_ERROR); 453 vb2_buffer_done(&bcap_dev->cur_frm->vb, VB2_BUF_STATE_ERROR);
454 } 454 }
455 return 0;
456} 455}
457 456
458static struct vb2_ops bcap_video_qops = { 457static struct vb2_ops bcap_video_qops = {
diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
index 3e5199ee5d25..d9b1a0409076 100644
--- a/drivers/media/platform/coda.c
+++ b/drivers/media/platform/coda.c
@@ -2269,7 +2269,7 @@ out:
2269 return ret; 2269 return ret;
2270} 2270}
2271 2271
2272static int coda_stop_streaming(struct vb2_queue *q) 2272static void coda_stop_streaming(struct vb2_queue *q)
2273{ 2273{
2274 struct coda_ctx *ctx = vb2_get_drv_priv(q); 2274 struct coda_ctx *ctx = vb2_get_drv_priv(q);
2275 struct coda_dev *dev = ctx->dev; 2275 struct coda_dev *dev = ctx->dev;
@@ -2295,8 +2295,6 @@ static int coda_stop_streaming(struct vb2_queue *q)
2295 ctx->bitstream.vaddr, ctx->bitstream.size); 2295 ctx->bitstream.vaddr, ctx->bitstream.size);
2296 ctx->runcounter = 0; 2296 ctx->runcounter = 0;
2297 } 2297 }
2298
2299 return 0;
2300} 2298}
2301 2299
2302static struct vb2_ops coda_qops = { 2300static struct vb2_ops coda_qops = {
diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
index a9ad949d0c19..4025b1b8aff4 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -368,7 +368,7 @@ static int vpbe_start_streaming(struct vb2_queue *vq, unsigned int count)
368 return ret; 368 return ret;
369} 369}
370 370
371static int vpbe_stop_streaming(struct vb2_queue *vq) 371static void vpbe_stop_streaming(struct vb2_queue *vq)
372{ 372{
373 struct vpbe_fh *fh = vb2_get_drv_priv(vq); 373 struct vpbe_fh *fh = vb2_get_drv_priv(vq);
374 struct vpbe_layer *layer = fh->layer; 374 struct vpbe_layer *layer = fh->layer;
@@ -376,7 +376,7 @@ static int vpbe_stop_streaming(struct vb2_queue *vq)
376 unsigned long flags; 376 unsigned long flags;
377 377
378 if (!vb2_is_streaming(vq)) 378 if (!vb2_is_streaming(vq))
379 return 0; 379 return;
380 380
381 /* release all active buffers */ 381 /* release all active buffers */
382 spin_lock_irqsave(&disp->dma_queue_lock, flags); 382 spin_lock_irqsave(&disp->dma_queue_lock, flags);
@@ -398,7 +398,6 @@ static int vpbe_stop_streaming(struct vb2_queue *vq)
398 vb2_buffer_done(&layer->next_frm->vb, VB2_BUF_STATE_ERROR); 398 vb2_buffer_done(&layer->next_frm->vb, VB2_BUF_STATE_ERROR);
399 } 399 }
400 spin_unlock_irqrestore(&disp->dma_queue_lock, flags); 400 spin_unlock_irqrestore(&disp->dma_queue_lock, flags);
401 return 0;
402} 401}
403 402
404static struct vb2_ops video_qops = { 403static struct vb2_ops video_qops = {
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index 8dea0b84a3ad..d09a27a23c5d 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -346,7 +346,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
346} 346}
347 347
348/* abort streaming and wait for last buffer */ 348/* abort streaming and wait for last buffer */
349static int vpif_stop_streaming(struct vb2_queue *vq) 349static void vpif_stop_streaming(struct vb2_queue *vq)
350{ 350{
351 struct vpif_fh *fh = vb2_get_drv_priv(vq); 351 struct vpif_fh *fh = vb2_get_drv_priv(vq);
352 struct channel_obj *ch = fh->channel; 352 struct channel_obj *ch = fh->channel;
@@ -354,7 +354,7 @@ static int vpif_stop_streaming(struct vb2_queue *vq)
354 unsigned long flags; 354 unsigned long flags;
355 355
356 if (!vb2_is_streaming(vq)) 356 if (!vb2_is_streaming(vq))
357 return 0; 357 return;
358 358
359 common = &ch->common[VPIF_VIDEO_INDEX]; 359 common = &ch->common[VPIF_VIDEO_INDEX];
360 360
@@ -390,8 +390,6 @@ static int vpif_stop_streaming(struct vb2_queue *vq)
390 vb2_buffer_done(&common->next_frm->vb, VB2_BUF_STATE_ERROR); 390 vb2_buffer_done(&common->next_frm->vb, VB2_BUF_STATE_ERROR);
391 } 391 }
392 spin_unlock_irqrestore(&common->irqlock, flags); 392 spin_unlock_irqrestore(&common->irqlock, flags);
393
394 return 0;
395} 393}
396 394
397static struct vb2_ops video_qops = { 395static struct vb2_ops video_qops = {
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index aed41edd0501..d03487fb1888 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -308,7 +308,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
308} 308}
309 309
310/* abort streaming and wait for last buffer */ 310/* abort streaming and wait for last buffer */
311static int vpif_stop_streaming(struct vb2_queue *vq) 311static void vpif_stop_streaming(struct vb2_queue *vq)
312{ 312{
313 struct vpif_fh *fh = vb2_get_drv_priv(vq); 313 struct vpif_fh *fh = vb2_get_drv_priv(vq);
314 struct channel_obj *ch = fh->channel; 314 struct channel_obj *ch = fh->channel;
@@ -316,7 +316,7 @@ static int vpif_stop_streaming(struct vb2_queue *vq)
316 unsigned long flags; 316 unsigned long flags;
317 317
318 if (!vb2_is_streaming(vq)) 318 if (!vb2_is_streaming(vq))
319 return 0; 319 return;
320 320
321 common = &ch->common[VPIF_VIDEO_INDEX]; 321 common = &ch->common[VPIF_VIDEO_INDEX];
322 322
@@ -352,8 +352,6 @@ static int vpif_stop_streaming(struct vb2_queue *vq)
352 vb2_buffer_done(&common->next_frm->vb, VB2_BUF_STATE_ERROR); 352 vb2_buffer_done(&common->next_frm->vb, VB2_BUF_STATE_ERROR);
353 } 353 }
354 spin_unlock_irqrestore(&common->irqlock, flags); 354 spin_unlock_irqrestore(&common->irqlock, flags);
355
356 return 0;
357} 355}
358 356
359static struct vb2_ops video_qops = { 357static struct vb2_ops video_qops = {
diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c
index d0ea94f58d6f..e434f1f03d7b 100644
--- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
+++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
@@ -66,15 +66,13 @@ static int gsc_m2m_start_streaming(struct vb2_queue *q, unsigned int count)
66 return ret > 0 ? 0 : ret; 66 return ret > 0 ? 0 : ret;
67} 67}
68 68
69static int gsc_m2m_stop_streaming(struct vb2_queue *q) 69static void gsc_m2m_stop_streaming(struct vb2_queue *q)
70{ 70{
71 struct gsc_ctx *ctx = q->drv_priv; 71 struct gsc_ctx *ctx = q->drv_priv;
72 72
73 __gsc_m2m_job_abort(ctx); 73 __gsc_m2m_job_abort(ctx);
74 74
75 pm_runtime_put(&ctx->gsc_dev->pdev->dev); 75 pm_runtime_put(&ctx->gsc_dev->pdev->dev);
76
77 return 0;
78} 76}
79 77
80void gsc_m2m_job_finish(struct gsc_ctx *ctx, int vb_state) 78void gsc_m2m_job_finish(struct gsc_ctx *ctx, int vb_state)
diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
index 92ae812abce2..3d2babd5067a 100644
--- a/drivers/media/platform/exynos4-is/fimc-capture.c
+++ b/drivers/media/platform/exynos4-is/fimc-capture.c
@@ -294,15 +294,15 @@ static int start_streaming(struct vb2_queue *q, unsigned int count)
294 return 0; 294 return 0;
295} 295}
296 296
297static int stop_streaming(struct vb2_queue *q) 297static void stop_streaming(struct vb2_queue *q)
298{ 298{
299 struct fimc_ctx *ctx = q->drv_priv; 299 struct fimc_ctx *ctx = q->drv_priv;
300 struct fimc_dev *fimc = ctx->fimc_dev; 300 struct fimc_dev *fimc = ctx->fimc_dev;
301 301
302 if (!fimc_capture_active(fimc)) 302 if (!fimc_capture_active(fimc))
303 return -EINVAL; 303 return;
304 304
305 return fimc_stop_capture(fimc, false); 305 fimc_stop_capture(fimc, false);
306} 306}
307 307
308int fimc_capture_suspend(struct fimc_dev *fimc) 308int fimc_capture_suspend(struct fimc_dev *fimc)
diff --git a/drivers/media/platform/exynos4-is/fimc-isp-video.c b/drivers/media/platform/exynos4-is/fimc-isp-video.c
index e92b4e115adb..ced46600e343 100644
--- a/drivers/media/platform/exynos4-is/fimc-isp-video.c
+++ b/drivers/media/platform/exynos4-is/fimc-isp-video.c
@@ -125,7 +125,7 @@ static int isp_video_capture_start_streaming(struct vb2_queue *q,
125 return ret; 125 return ret;
126} 126}
127 127
128static int isp_video_capture_stop_streaming(struct vb2_queue *q) 128static void isp_video_capture_stop_streaming(struct vb2_queue *q)
129{ 129{
130 struct fimc_isp *isp = vb2_get_drv_priv(q); 130 struct fimc_isp *isp = vb2_get_drv_priv(q);
131 struct fimc_is *is = fimc_isp_to_is(isp); 131 struct fimc_is *is = fimc_isp_to_is(isp);
@@ -134,7 +134,7 @@ static int isp_video_capture_stop_streaming(struct vb2_queue *q)
134 134
135 ret = fimc_pipeline_call(&isp->video_capture.ve, set_stream, 0); 135 ret = fimc_pipeline_call(&isp->video_capture.ve, set_stream, 0);
136 if (ret < 0) 136 if (ret < 0)
137 return ret; 137 return;
138 138
139 dma->cmd = DMA_OUTPUT_COMMAND_DISABLE; 139 dma->cmd = DMA_OUTPUT_COMMAND_DISABLE;
140 dma->notify_dma_done = DMA_OUTPUT_NOTIFY_DMA_DONE_DISABLE; 140 dma->notify_dma_done = DMA_OUTPUT_NOTIFY_DMA_DONE_DISABLE;
@@ -155,7 +155,6 @@ static int isp_video_capture_stop_streaming(struct vb2_queue *q)
155 clear_bit(ST_ISP_VID_CAP_STREAMING, &isp->state); 155 clear_bit(ST_ISP_VID_CAP_STREAMING, &isp->state);
156 156
157 isp->video_capture.buf_count = 0; 157 isp->video_capture.buf_count = 0;
158 return 0;
159} 158}
160 159
161static int isp_video_capture_buffer_prepare(struct vb2_buffer *vb) 160static int isp_video_capture_buffer_prepare(struct vb2_buffer *vb)
diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
index 3ad660b55b6b..630aef52dbb8 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite.c
@@ -350,14 +350,14 @@ static int start_streaming(struct vb2_queue *q, unsigned int count)
350 return 0; 350 return 0;
351} 351}
352 352
353static int stop_streaming(struct vb2_queue *q) 353static void stop_streaming(struct vb2_queue *q)
354{ 354{
355 struct fimc_lite *fimc = q->drv_priv; 355 struct fimc_lite *fimc = q->drv_priv;
356 356
357 if (!fimc_lite_active(fimc)) 357 if (!fimc_lite_active(fimc))
358 return -EINVAL; 358 return;
359 359
360 return fimc_lite_stop_capture(fimc, false); 360 fimc_lite_stop_capture(fimc, false);
361} 361}
362 362
363static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt, 363static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
diff --git a/drivers/media/platform/exynos4-is/fimc-m2m.c b/drivers/media/platform/exynos4-is/fimc-m2m.c
index 36971d915b53..d314155da9e4 100644
--- a/drivers/media/platform/exynos4-is/fimc-m2m.c
+++ b/drivers/media/platform/exynos4-is/fimc-m2m.c
@@ -85,7 +85,7 @@ static int start_streaming(struct vb2_queue *q, unsigned int count)
85 return ret > 0 ? 0 : ret; 85 return ret > 0 ? 0 : ret;
86} 86}
87 87
88static int stop_streaming(struct vb2_queue *q) 88static void stop_streaming(struct vb2_queue *q)
89{ 89{
90 struct fimc_ctx *ctx = q->drv_priv; 90 struct fimc_ctx *ctx = q->drv_priv;
91 int ret; 91 int ret;
@@ -95,7 +95,6 @@ static int stop_streaming(struct vb2_queue *q)
95 fimc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR); 95 fimc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
96 96
97 pm_runtime_put(&ctx->fimc_dev->pdev->dev); 97 pm_runtime_put(&ctx->fimc_dev->pdev->dev);
98 return 0;
99} 98}
100 99
101static void fimc_device_run(void *priv) 100static void fimc_device_run(void *priv)
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
index 8b34c485be79..be4b51212106 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.c
+++ b/drivers/media/platform/marvell-ccic/mcam-core.c
@@ -1156,7 +1156,7 @@ static int mcam_vb_start_streaming(struct vb2_queue *vq, unsigned int count)
1156 return mcam_read_setup(cam); 1156 return mcam_read_setup(cam);
1157} 1157}
1158 1158
1159static int mcam_vb_stop_streaming(struct vb2_queue *vq) 1159static void mcam_vb_stop_streaming(struct vb2_queue *vq)
1160{ 1160{
1161 struct mcam_camera *cam = vb2_get_drv_priv(vq); 1161 struct mcam_camera *cam = vb2_get_drv_priv(vq);
1162 unsigned long flags; 1162 unsigned long flags;
@@ -1164,10 +1164,10 @@ static int mcam_vb_stop_streaming(struct vb2_queue *vq)
1164 if (cam->state == S_BUFWAIT) { 1164 if (cam->state == S_BUFWAIT) {
1165 /* They never gave us buffers */ 1165 /* They never gave us buffers */
1166 cam->state = S_IDLE; 1166 cam->state = S_IDLE;
1167 return 0; 1167 return;
1168 } 1168 }
1169 if (cam->state != S_STREAMING) 1169 if (cam->state != S_STREAMING)
1170 return -EINVAL; 1170 return;
1171 mcam_ctlr_stop_dma(cam); 1171 mcam_ctlr_stop_dma(cam);
1172 /* 1172 /*
1173 * Reset the CCIC PHY after stopping streaming, 1173 * Reset the CCIC PHY after stopping streaming,
@@ -1182,7 +1182,6 @@ static int mcam_vb_stop_streaming(struct vb2_queue *vq)
1182 spin_lock_irqsave(&cam->dev_lock, flags); 1182 spin_lock_irqsave(&cam->dev_lock, flags);
1183 INIT_LIST_HEAD(&cam->buffers); 1183 INIT_LIST_HEAD(&cam->buffers);
1184 spin_unlock_irqrestore(&cam->dev_lock, flags); 1184 spin_unlock_irqrestore(&cam->dev_lock, flags);
1185 return 0;
1186} 1185}
1187 1186
1188 1187
diff --git a/drivers/media/platform/mem2mem_testdev.c b/drivers/media/platform/mem2mem_testdev.c
index 4f3096b17066..0714070ed7fa 100644
--- a/drivers/media/platform/mem2mem_testdev.c
+++ b/drivers/media/platform/mem2mem_testdev.c
@@ -787,7 +787,7 @@ static int m2mtest_start_streaming(struct vb2_queue *q, unsigned count)
787 return 0; 787 return 0;
788} 788}
789 789
790static int m2mtest_stop_streaming(struct vb2_queue *q) 790static void m2mtest_stop_streaming(struct vb2_queue *q)
791{ 791{
792 struct m2mtest_ctx *ctx = vb2_get_drv_priv(q); 792 struct m2mtest_ctx *ctx = vb2_get_drv_priv(q);
793 struct vb2_buffer *vb; 793 struct vb2_buffer *vb;
@@ -799,12 +799,11 @@ static int m2mtest_stop_streaming(struct vb2_queue *q)
799 else 799 else
800 vb = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx); 800 vb = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
801 if (vb == NULL) 801 if (vb == NULL)
802 return 0; 802 return;
803 spin_lock_irqsave(&ctx->dev->irqlock, flags); 803 spin_lock_irqsave(&ctx->dev->irqlock, flags);
804 v4l2_m2m_buf_done(vb, VB2_BUF_STATE_ERROR); 804 v4l2_m2m_buf_done(vb, VB2_BUF_STATE_ERROR);
805 spin_unlock_irqrestore(&ctx->dev->irqlock, flags); 805 spin_unlock_irqrestore(&ctx->dev->irqlock, flags);
806 } 806 }
807 return 0;
808} 807}
809 808
810static struct vb2_ops m2mtest_qops = { 809static struct vb2_ops m2mtest_qops = {
diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c
index 4e4d1631e042..deba425e3d8f 100644
--- a/drivers/media/platform/s3c-camif/camif-capture.c
+++ b/drivers/media/platform/s3c-camif/camif-capture.c
@@ -435,10 +435,10 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
435 return 0; 435 return 0;
436} 436}
437 437
438static int stop_streaming(struct vb2_queue *vq) 438static void stop_streaming(struct vb2_queue *vq)
439{ 439{
440 struct camif_vp *vp = vb2_get_drv_priv(vq); 440 struct camif_vp *vp = vb2_get_drv_priv(vq);
441 return camif_stop_capture(vp); 441 camif_stop_capture(vp);
442} 442}
443 443
444static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt, 444static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 8a18972012f7..368b3f6df24b 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1670,13 +1670,11 @@ static int s5p_jpeg_start_streaming(struct vb2_queue *q, unsigned int count)
1670 return ret > 0 ? 0 : ret; 1670 return ret > 0 ? 0 : ret;
1671} 1671}
1672 1672
1673static int s5p_jpeg_stop_streaming(struct vb2_queue *q) 1673static void s5p_jpeg_stop_streaming(struct vb2_queue *q)
1674{ 1674{
1675 struct s5p_jpeg_ctx *ctx = vb2_get_drv_priv(q); 1675 struct s5p_jpeg_ctx *ctx = vb2_get_drv_priv(q);
1676 1676
1677 pm_runtime_put(ctx->jpeg->dev); 1677 pm_runtime_put(ctx->jpeg->dev);
1678
1679 return 0;
1680} 1678}
1681 1679
1682static struct vb2_ops s5p_jpeg_qops = { 1680static struct vb2_ops s5p_jpeg_qops = {
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index 8faf9691712d..58b7bbaa2da0 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -1027,7 +1027,7 @@ static int s5p_mfc_start_streaming(struct vb2_queue *q, unsigned int count)
1027 return 0; 1027 return 0;
1028} 1028}
1029 1029
1030static int s5p_mfc_stop_streaming(struct vb2_queue *q) 1030static void s5p_mfc_stop_streaming(struct vb2_queue *q)
1031{ 1031{
1032 unsigned long flags; 1032 unsigned long flags;
1033 struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv); 1033 struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv);
@@ -1071,7 +1071,6 @@ static int s5p_mfc_stop_streaming(struct vb2_queue *q)
1071 } 1071 }
1072 if (aborted) 1072 if (aborted)
1073 ctx->state = MFCINST_RUNNING; 1073 ctx->state = MFCINST_RUNNING;
1074 return 0;
1075} 1074}
1076 1075
1077 1076
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
index df83cd157bab..458279e5dc80 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
@@ -1954,7 +1954,7 @@ static int s5p_mfc_start_streaming(struct vb2_queue *q, unsigned int count)
1954 return 0; 1954 return 0;
1955} 1955}
1956 1956
1957static int s5p_mfc_stop_streaming(struct vb2_queue *q) 1957static void s5p_mfc_stop_streaming(struct vb2_queue *q)
1958{ 1958{
1959 unsigned long flags; 1959 unsigned long flags;
1960 struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv); 1960 struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv);
@@ -1983,7 +1983,6 @@ static int s5p_mfc_stop_streaming(struct vb2_queue *q)
1983 ctx->src_queue_cnt = 0; 1983 ctx->src_queue_cnt = 0;
1984 } 1984 }
1985 spin_unlock_irqrestore(&dev->irqlock, flags); 1985 spin_unlock_irqrestore(&dev->irqlock, flags);
1986 return 0;
1987} 1986}
1988 1987
1989static void s5p_mfc_buf_queue(struct vb2_buffer *vb) 1988static void s5p_mfc_buf_queue(struct vb2_buffer *vb)
diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c
index a1ce55fd30f3..9f1e52f0bd09 100644
--- a/drivers/media/platform/s5p-tv/mixer_video.c
+++ b/drivers/media/platform/s5p-tv/mixer_video.c
@@ -985,7 +985,7 @@ static void mxr_watchdog(unsigned long arg)
985 spin_unlock_irqrestore(&layer->enq_slock, flags); 985 spin_unlock_irqrestore(&layer->enq_slock, flags);
986} 986}
987 987
988static int stop_streaming(struct vb2_queue *vq) 988static void stop_streaming(struct vb2_queue *vq)
989{ 989{
990 struct mxr_layer *layer = vb2_get_drv_priv(vq); 990 struct mxr_layer *layer = vb2_get_drv_priv(vq);
991 struct mxr_device *mdev = layer->mdev; 991 struct mxr_device *mdev = layer->mdev;
@@ -1031,7 +1031,6 @@ static int stop_streaming(struct vb2_queue *vq)
1031 mxr_streamer_put(mdev); 1031 mxr_streamer_put(mdev);
1032 /* allow changes in output configuration */ 1032 /* allow changes in output configuration */
1033 mxr_output_put(mdev); 1033 mxr_output_put(mdev);
1034 return 0;
1035} 1034}
1036 1035
1037static struct vb2_ops mxr_video_qops = { 1036static struct vb2_ops mxr_video_qops = {
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c
index f0b6c900034d..38c723aca438 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -406,7 +406,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
406} 406}
407 407
408/* abort streaming and wait for last buffer */ 408/* abort streaming and wait for last buffer */
409static int stop_streaming(struct vb2_queue *vq) 409static void stop_streaming(struct vb2_queue *vq)
410{ 410{
411 struct soc_camera_device *icd = soc_camera_from_vb2q(vq); 411 struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
412 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 412 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
@@ -433,7 +433,7 @@ static int stop_streaming(struct vb2_queue *vq)
433 if (time_after(jiffies, timeout)) { 433 if (time_after(jiffies, timeout)) {
434 dev_err(icd->parent, 434 dev_err(icd->parent,
435 "Timeout waiting for finishing codec request\n"); 435 "Timeout waiting for finishing codec request\n");
436 return -ETIMEDOUT; 436 return;
437 } 437 }
438 438
439 /* Disable interrupts */ 439 /* Disable interrupts */
@@ -444,8 +444,6 @@ static int stop_streaming(struct vb2_queue *vq)
444 ret = atmel_isi_wait_status(isi, WAIT_ISI_DISABLE); 444 ret = atmel_isi_wait_status(isi, WAIT_ISI_DISABLE);
445 if (ret < 0) 445 if (ret < 0)
446 dev_err(icd->parent, "Disable ISI timed out\n"); 446 dev_err(icd->parent, "Disable ISI timed out\n");
447
448 return ret;
449} 447}
450 448
451static struct vb2_ops isi_video_qops = { 449static struct vb2_ops isi_video_qops = {
diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c
index 3e844803bdca..b40bc2e5ba47 100644
--- a/drivers/media/platform/soc_camera/mx2_camera.c
+++ b/drivers/media/platform/soc_camera/mx2_camera.c
@@ -741,7 +741,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
741 return 0; 741 return 0;
742} 742}
743 743
744static int mx2_stop_streaming(struct vb2_queue *q) 744static void mx2_stop_streaming(struct vb2_queue *q)
745{ 745{
746 struct soc_camera_device *icd = soc_camera_from_vb2q(q); 746 struct soc_camera_device *icd = soc_camera_from_vb2q(q);
747 struct soc_camera_host *ici = 747 struct soc_camera_host *ici =
@@ -773,8 +773,6 @@ static int mx2_stop_streaming(struct vb2_queue *q)
773 773
774 dma_free_coherent(ici->v4l2_dev.dev, 774 dma_free_coherent(ici->v4l2_dev.dev,
775 pcdev->discard_size, b, pcdev->discard_buffer_dma); 775 pcdev->discard_size, b, pcdev->discard_buffer_dma);
776
777 return 0;
778} 776}
779 777
780static struct vb2_ops mx2_videobuf_ops = { 778static struct vb2_ops mx2_videobuf_ops = {
diff --git a/drivers/media/platform/soc_camera/mx3_camera.c b/drivers/media/platform/soc_camera/mx3_camera.c
index 9ed81ac6881c..83315dfeef62 100644
--- a/drivers/media/platform/soc_camera/mx3_camera.c
+++ b/drivers/media/platform/soc_camera/mx3_camera.c
@@ -406,7 +406,7 @@ static int mx3_videobuf_init(struct vb2_buffer *vb)
406 return 0; 406 return 0;
407} 407}
408 408
409static int mx3_stop_streaming(struct vb2_queue *q) 409static void mx3_stop_streaming(struct vb2_queue *q)
410{ 410{
411 struct soc_camera_device *icd = soc_camera_from_vb2q(q); 411 struct soc_camera_device *icd = soc_camera_from_vb2q(q);
412 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 412 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
@@ -430,8 +430,6 @@ static int mx3_stop_streaming(struct vb2_queue *q)
430 } 430 }
431 431
432 spin_unlock_irqrestore(&mx3_cam->lock, flags); 432 spin_unlock_irqrestore(&mx3_cam->lock, flags);
433
434 return 0;
435} 433}
436 434
437static struct vb2_ops mx3_videobuf_ops = { 435static struct vb2_ops mx3_videobuf_ops = {
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
index 704eee766487..e594230e84d3 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -513,7 +513,7 @@ static int rcar_vin_videobuf_init(struct vb2_buffer *vb)
513 return 0; 513 return 0;
514} 514}
515 515
516static int rcar_vin_stop_streaming(struct vb2_queue *vq) 516static void rcar_vin_stop_streaming(struct vb2_queue *vq)
517{ 517{
518 struct soc_camera_device *icd = soc_camera_from_vb2q(vq); 518 struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
519 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 519 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
@@ -524,8 +524,6 @@ static int rcar_vin_stop_streaming(struct vb2_queue *vq)
524 list_for_each_safe(buf_head, tmp, &priv->capture) 524 list_for_each_safe(buf_head, tmp, &priv->capture)
525 list_del_init(buf_head); 525 list_del_init(buf_head);
526 spin_unlock_irq(&priv->lock); 526 spin_unlock_irq(&priv->lock);
527
528 return 0;
529} 527}
530 528
531static struct vb2_ops rcar_vin_vb2_ops = { 529static struct vb2_ops rcar_vin_vb2_ops = {
diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
index 3e75a469cd49..20ad4a571d37 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
@@ -471,7 +471,7 @@ static int sh_mobile_ceu_videobuf_init(struct vb2_buffer *vb)
471 return 0; 471 return 0;
472} 472}
473 473
474static int sh_mobile_ceu_stop_streaming(struct vb2_queue *q) 474static void sh_mobile_ceu_stop_streaming(struct vb2_queue *q)
475{ 475{
476 struct soc_camera_device *icd = container_of(q, struct soc_camera_device, vb2_vidq); 476 struct soc_camera_device *icd = container_of(q, struct soc_camera_device, vb2_vidq);
477 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 477 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
@@ -487,7 +487,7 @@ static int sh_mobile_ceu_stop_streaming(struct vb2_queue *q)
487 487
488 spin_unlock_irq(&pcdev->lock); 488 spin_unlock_irq(&pcdev->lock);
489 489
490 return sh_mobile_ceu_soft_reset(pcdev); 490 sh_mobile_ceu_soft_reset(pcdev);
491} 491}
492 492
493static struct vb2_ops sh_mobile_ceu_videobuf_ops = { 493static struct vb2_ops sh_mobile_ceu_videobuf_ops = {
diff --git a/drivers/media/platform/vivi.c b/drivers/media/platform/vivi.c
index 3890f4f42a78..d00bf3df0f8a 100644
--- a/drivers/media/platform/vivi.c
+++ b/drivers/media/platform/vivi.c
@@ -906,12 +906,11 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
906} 906}
907 907
908/* abort streaming and wait for last buffer */ 908/* abort streaming and wait for last buffer */
909static int stop_streaming(struct vb2_queue *vq) 909static void stop_streaming(struct vb2_queue *vq)
910{ 910{
911 struct vivi_dev *dev = vb2_get_drv_priv(vq); 911 struct vivi_dev *dev = vb2_get_drv_priv(vq);
912 dprintk(dev, 1, "%s\n", __func__); 912 dprintk(dev, 1, "%s\n", __func__);
913 vivi_stop_generating(dev); 913 vivi_stop_generating(dev);
914 return 0;
915} 914}
916 915
917static void vivi_lock(struct vb2_queue *vq) 916static void vivi_lock(struct vb2_queue *vq)
diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
index b48f135ffc01..a0595c17700f 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -720,7 +720,7 @@ static int vsp1_video_start_streaming(struct vb2_queue *vq, unsigned int count)
720 return 0; 720 return 0;
721} 721}
722 722
723static int vsp1_video_stop_streaming(struct vb2_queue *vq) 723static void vsp1_video_stop_streaming(struct vb2_queue *vq)
724{ 724{
725 struct vsp1_video *video = vb2_get_drv_priv(vq); 725 struct vsp1_video *video = vb2_get_drv_priv(vq);
726 struct vsp1_pipeline *pipe = to_vsp1_pipeline(&video->video.entity); 726 struct vsp1_pipeline *pipe = to_vsp1_pipeline(&video->video.entity);
@@ -743,8 +743,6 @@ static int vsp1_video_stop_streaming(struct vb2_queue *vq)
743 spin_lock_irqsave(&video->irqlock, flags); 743 spin_lock_irqsave(&video->irqlock, flags);
744 INIT_LIST_HEAD(&video->irqqueue); 744 INIT_LIST_HEAD(&video->irqqueue);
745 spin_unlock_irqrestore(&video->irqlock, flags); 745 spin_unlock_irqrestore(&video->irqlock, flags);
746
747 return 0;
748} 746}
749 747
750static struct vb2_ops vsp1_video_queue_qops = { 748static struct vb2_ops vsp1_video_queue_qops = {
diff --git a/drivers/media/usb/em28xx/em28xx-v4l.h b/drivers/media/usb/em28xx/em28xx-v4l.h
index bce438691e0e..432862c20bbf 100644
--- a/drivers/media/usb/em28xx/em28xx-v4l.h
+++ b/drivers/media/usb/em28xx/em28xx-v4l.h
@@ -16,5 +16,5 @@
16 16
17 17
18int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count); 18int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count);
19int em28xx_stop_vbi_streaming(struct vb2_queue *vq); 19void em28xx_stop_vbi_streaming(struct vb2_queue *vq);
20extern struct vb2_ops em28xx_vbi_qops; 20extern struct vb2_ops em28xx_vbi_qops;
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 0856e5d367b6..cdcd7513e6ec 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -937,7 +937,7 @@ int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count)
937 return rc; 937 return rc;
938} 938}
939 939
940static int em28xx_stop_streaming(struct vb2_queue *vq) 940static void em28xx_stop_streaming(struct vb2_queue *vq)
941{ 941{
942 struct em28xx *dev = vb2_get_drv_priv(vq); 942 struct em28xx *dev = vb2_get_drv_priv(vq);
943 struct em28xx_dmaqueue *vidq = &dev->vidq; 943 struct em28xx_dmaqueue *vidq = &dev->vidq;
@@ -961,11 +961,9 @@ static int em28xx_stop_streaming(struct vb2_queue *vq)
961 } 961 }
962 dev->usb_ctl.vid_buf = NULL; 962 dev->usb_ctl.vid_buf = NULL;
963 spin_unlock_irqrestore(&dev->slock, flags); 963 spin_unlock_irqrestore(&dev->slock, flags);
964
965 return 0;
966} 964}
967 965
968int em28xx_stop_vbi_streaming(struct vb2_queue *vq) 966void em28xx_stop_vbi_streaming(struct vb2_queue *vq)
969{ 967{
970 struct em28xx *dev = vb2_get_drv_priv(vq); 968 struct em28xx *dev = vb2_get_drv_priv(vq);
971 struct em28xx_dmaqueue *vbiq = &dev->vbiq; 969 struct em28xx_dmaqueue *vbiq = &dev->vbiq;
@@ -989,8 +987,6 @@ int em28xx_stop_vbi_streaming(struct vb2_queue *vq)
989 } 987 }
990 dev->usb_ctl.vbi_buf = NULL; 988 dev->usb_ctl.vbi_buf = NULL;
991 spin_unlock_irqrestore(&dev->slock, flags); 989 spin_unlock_irqrestore(&dev->slock, flags);
992
993 return 0;
994} 990}
995 991
996static void 992static void
diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
index 84a6720b1d00..a73b0bced96f 100644
--- a/drivers/media/usb/pwc/pwc-if.c
+++ b/drivers/media/usb/pwc/pwc-if.c
@@ -681,12 +681,11 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
681 return r; 681 return r;
682} 682}
683 683
684static int stop_streaming(struct vb2_queue *vq) 684static void stop_streaming(struct vb2_queue *vq)
685{ 685{
686 struct pwc_device *pdev = vb2_get_drv_priv(vq); 686 struct pwc_device *pdev = vb2_get_drv_priv(vq);
687 687
688 if (mutex_lock_interruptible(&pdev->v4l2_lock)) 688 mutex_lock(&pdev->v4l2_lock);
689 return -ERESTARTSYS;
690 if (pdev->udev) { 689 if (pdev->udev) {
691 pwc_set_leds(pdev, 0, 0); 690 pwc_set_leds(pdev, 0, 0);
692 pwc_camera_power(pdev, 0); 691 pwc_camera_power(pdev, 0);
@@ -695,8 +694,6 @@ static int stop_streaming(struct vb2_queue *vq)
695 694
696 pwc_cleanup_queued_bufs(pdev); 695 pwc_cleanup_queued_bufs(pdev);
697 mutex_unlock(&pdev->v4l2_lock); 696 mutex_unlock(&pdev->v4l2_lock);
698
699 return 0;
700} 697}
701 698
702static struct vb2_ops pwc_vb_queue_ops = { 699static struct vb2_ops pwc_vb_queue_ops = {
diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
index 1d4ba2b80490..e019dd63ed42 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -714,7 +714,7 @@ static void buffer_queue(struct vb2_buffer *vb)
714} 714}
715 715
716static int start_streaming(struct vb2_queue *vq, unsigned int count); 716static int start_streaming(struct vb2_queue *vq, unsigned int count);
717static int stop_streaming(struct vb2_queue *vq); 717static void stop_streaming(struct vb2_queue *vq);
718 718
719static struct vb2_ops s2255_video_qops = { 719static struct vb2_ops s2255_video_qops = {
720 .queue_setup = queue_setup, 720 .queue_setup = queue_setup,
@@ -1109,7 +1109,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
1109} 1109}
1110 1110
1111/* abort streaming and wait for last buffer */ 1111/* abort streaming and wait for last buffer */
1112static int stop_streaming(struct vb2_queue *vq) 1112static void stop_streaming(struct vb2_queue *vq)
1113{ 1113{
1114 struct s2255_vc *vc = vb2_get_drv_priv(vq); 1114 struct s2255_vc *vc = vb2_get_drv_priv(vq);
1115 struct s2255_buffer *buf, *node; 1115 struct s2255_buffer *buf, *node;
@@ -1123,7 +1123,6 @@ static int stop_streaming(struct vb2_queue *vq)
1123 buf, buf->vb.v4l2_buf.index); 1123 buf, buf->vb.v4l2_buf.index);
1124 } 1124 }
1125 spin_unlock_irqrestore(&vc->qlock, flags); 1125 spin_unlock_irqrestore(&vc->qlock, flags);
1126 return 0;
1127} 1126}
1128 1127
1129static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id i) 1128static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id i)
diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c
index 37bc00f418f1..46e8a5069b37 100644
--- a/drivers/media/usb/stk1160/stk1160-v4l.c
+++ b/drivers/media/usb/stk1160/stk1160-v4l.c
@@ -583,10 +583,10 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
583} 583}
584 584
585/* abort streaming and wait for last buffer */ 585/* abort streaming and wait for last buffer */
586static int stop_streaming(struct vb2_queue *vq) 586static void stop_streaming(struct vb2_queue *vq)
587{ 587{
588 struct stk1160 *dev = vb2_get_drv_priv(vq); 588 struct stk1160 *dev = vb2_get_drv_priv(vq);
589 return stk1160_stop_streaming(dev); 589 stk1160_stop_streaming(dev);
590} 590}
591 591
592static struct vb2_ops stk1160_video_qops = { 592static struct vb2_ops stk1160_video_qops = {
diff --git a/drivers/media/usb/usbtv/usbtv-video.c b/drivers/media/usb/usbtv/usbtv-video.c
index 20365bd69d05..2967e808408b 100644
--- a/drivers/media/usb/usbtv/usbtv-video.c
+++ b/drivers/media/usb/usbtv/usbtv-video.c
@@ -634,15 +634,12 @@ static int usbtv_start_streaming(struct vb2_queue *vq, unsigned int count)
634 return usbtv_start(usbtv); 634 return usbtv_start(usbtv);
635} 635}
636 636
637static int usbtv_stop_streaming(struct vb2_queue *vq) 637static void usbtv_stop_streaming(struct vb2_queue *vq)
638{ 638{
639 struct usbtv *usbtv = vb2_get_drv_priv(vq); 639 struct usbtv *usbtv = vb2_get_drv_priv(vq);
640 640
641 if (usbtv->udev == NULL) 641 if (usbtv->udev)
642 return -ENODEV; 642 usbtv_stop(usbtv);
643
644 usbtv_stop(usbtv);
645 return 0;
646} 643}
647 644
648static struct vb2_ops usbtv_vb2_ops = { 645static struct vb2_ops usbtv_vb2_ops = {
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index 3f0cdb150dfd..f8f694a239f8 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -2086,7 +2086,7 @@ static void __vb2_queue_cancel(struct vb2_queue *q)
2086 * buffers. 2086 * buffers.
2087 */ 2087 */
2088 if (q->start_streaming_called) 2088 if (q->start_streaming_called)
2089 call_qop(q, stop_streaming, q); 2089 call_void_qop(q, stop_streaming, q);
2090 q->streaming = 0; 2090 q->streaming = 0;
2091 q->start_streaming_called = 0; 2091 q->start_streaming_called = 0;
2092 q->queued_count = 0; 2092 q->queued_count = 0;
diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c
index 9337d92c5939..7b213a7f9623 100644
--- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
+++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
@@ -1249,7 +1249,7 @@ static int vpfe_buffer_init(struct vb2_buffer *vb)
1249} 1249}
1250 1250
1251/* abort streaming and wait for last buffer */ 1251/* abort streaming and wait for last buffer */
1252static int vpfe_stop_streaming(struct vb2_queue *vq) 1252static void vpfe_stop_streaming(struct vb2_queue *vq)
1253{ 1253{
1254 struct vpfe_fh *fh = vb2_get_drv_priv(vq); 1254 struct vpfe_fh *fh = vb2_get_drv_priv(vq);
1255 struct vpfe_video_device *video = fh->video; 1255 struct vpfe_video_device *video = fh->video;
@@ -1272,7 +1272,6 @@ static int vpfe_stop_streaming(struct vb2_queue *vq)
1272 list_del(&video->next_frm->list); 1272 list_del(&video->next_frm->list);
1273 vb2_buffer_done(&video->next_frm->vb, VB2_BUF_STATE_ERROR); 1273 vb2_buffer_done(&video->next_frm->vb, VB2_BUF_STATE_ERROR);
1274 } 1274 }
1275 return 0;
1276} 1275}
1277 1276
1278static void vpfe_buf_cleanup(struct vb2_buffer *vb) 1277static void vpfe_buf_cleanup(struct vb2_buffer *vb)
diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c b/drivers/staging/media/dt3155v4l/dt3155v4l.c
index afbc2e519606..14bdc19ec48f 100644
--- a/drivers/staging/media/dt3155v4l/dt3155v4l.c
+++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c
@@ -262,7 +262,7 @@ dt3155_buf_prepare(struct vb2_buffer *vb)
262 return 0; 262 return 0;
263} 263}
264 264
265static int 265static void
266dt3155_stop_streaming(struct vb2_queue *q) 266dt3155_stop_streaming(struct vb2_queue *q)
267{ 267{
268 struct dt3155_priv *pd = vb2_get_drv_priv(q); 268 struct dt3155_priv *pd = vb2_get_drv_priv(q);
@@ -276,7 +276,6 @@ dt3155_stop_streaming(struct vb2_queue *q)
276 } 276 }
277 spin_unlock_irq(&pd->lock); 277 spin_unlock_irq(&pd->lock);
278 msleep(45); /* irq hendler will stop the hardware */ 278 msleep(45); /* irq hendler will stop the hardware */
279 return 0;
280} 279}
281 280
282static void 281static void
diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index b397aa3c0f44..090b3e6e852a 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -516,7 +516,7 @@ static int go7007_start_streaming(struct vb2_queue *q, unsigned int count)
516 return ret; 516 return ret;
517} 517}
518 518
519static int go7007_stop_streaming(struct vb2_queue *q) 519static void go7007_stop_streaming(struct vb2_queue *q)
520{ 520{
521 struct go7007 *go = vb2_get_drv_priv(q); 521 struct go7007 *go = vb2_get_drv_priv(q);
522 unsigned long flags; 522 unsigned long flags;
@@ -538,7 +538,6 @@ static int go7007_stop_streaming(struct vb2_queue *q)
538 /* Turn on Capture LED */ 538 /* Turn on Capture LED */
539 if (go->board_id == GO7007_BOARDID_ADS_USBAV_709) 539 if (go->board_id == GO7007_BOARDID_ADS_USBAV_709)
540 go7007_write_addr(go, 0x3c82, 0x000d); 540 go7007_write_addr(go, 0x3c82, 0x000d);
541 return 0;
542} 541}
543 542
544static struct vb2_ops go7007_video_qops = { 543static struct vb2_ops go7007_video_qops = {
diff --git a/drivers/staging/media/msi3101/sdr-msi3101.c b/drivers/staging/media/msi3101/sdr-msi3101.c
index 65d351f99da2..08d0d096b881 100644
--- a/drivers/staging/media/msi3101/sdr-msi3101.c
+++ b/drivers/staging/media/msi3101/sdr-msi3101.c
@@ -1074,14 +1074,13 @@ static int msi3101_start_streaming(struct vb2_queue *vq, unsigned int count)
1074 return ret; 1074 return ret;
1075} 1075}
1076 1076
1077static int msi3101_stop_streaming(struct vb2_queue *vq) 1077static void msi3101_stop_streaming(struct vb2_queue *vq)
1078{ 1078{
1079 struct msi3101_state *s = vb2_get_drv_priv(vq); 1079 struct msi3101_state *s = vb2_get_drv_priv(vq);
1080 int ret; 1080
1081 dev_dbg(&s->udev->dev, "%s:\n", __func__); 1081 dev_dbg(&s->udev->dev, "%s:\n", __func__);
1082 1082
1083 if (mutex_lock_interruptible(&s->v4l2_lock)) 1083 mutex_lock(&s->v4l2_lock);
1084 return -ERESTARTSYS;
1085 1084
1086 if (s->udev) 1085 if (s->udev)
1087 msi3101_isoc_cleanup(s); 1086 msi3101_isoc_cleanup(s);
@@ -1090,22 +1089,15 @@ static int msi3101_stop_streaming(struct vb2_queue *vq)
1090 1089
1091 /* according to tests, at least 700us delay is required */ 1090 /* according to tests, at least 700us delay is required */
1092 msleep(20); 1091 msleep(20);
1093 ret = msi3101_ctrl_msg(s, CMD_STOP_STREAMING, 0); 1092 if (!msi3101_ctrl_msg(s, CMD_STOP_STREAMING, 0)) {
1094 if (ret) 1093 /* sleep USB IF / ADC */
1095 goto err_sleep_tuner; 1094 msi3101_ctrl_msg(s, CMD_WREG, 0x01000003);
1096 1095 }
1097 /* sleep USB IF / ADC */
1098 ret = msi3101_ctrl_msg(s, CMD_WREG, 0x01000003);
1099 if (ret)
1100 goto err_sleep_tuner;
1101 1096
1102err_sleep_tuner:
1103 /* sleep tuner */ 1097 /* sleep tuner */
1104 ret = v4l2_subdev_call(s->v4l2_subdev, core, s_power, 0); 1098 v4l2_subdev_call(s->v4l2_subdev, core, s_power, 0);
1105 1099
1106 mutex_unlock(&s->v4l2_lock); 1100 mutex_unlock(&s->v4l2_lock);
1107
1108 return ret;
1109} 1101}
1110 1102
1111static struct vb2_ops msi3101_vb2_ops = { 1103static struct vb2_ops msi3101_vb2_ops = {
diff --git a/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c b/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c
index 104ee8af79af..093df6b6ae35 100644
--- a/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c
+++ b/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c
@@ -1032,13 +1032,12 @@ err:
1032 return ret; 1032 return ret;
1033} 1033}
1034 1034
1035static int rtl2832_sdr_stop_streaming(struct vb2_queue *vq) 1035static void rtl2832_sdr_stop_streaming(struct vb2_queue *vq)
1036{ 1036{
1037 struct rtl2832_sdr_state *s = vb2_get_drv_priv(vq); 1037 struct rtl2832_sdr_state *s = vb2_get_drv_priv(vq);
1038 dev_dbg(&s->udev->dev, "%s:\n", __func__); 1038 dev_dbg(&s->udev->dev, "%s:\n", __func__);
1039 1039
1040 if (mutex_lock_interruptible(&s->v4l2_lock)) 1040 mutex_lock(&s->v4l2_lock);
1041 return -ERESTARTSYS;
1042 1041
1043 rtl2832_sdr_kill_urbs(s); 1042 rtl2832_sdr_kill_urbs(s);
1044 rtl2832_sdr_free_urbs(s); 1043 rtl2832_sdr_free_urbs(s);
@@ -1053,8 +1052,6 @@ static int rtl2832_sdr_stop_streaming(struct vb2_queue *vq)
1053 s->d->props->power_ctrl(s->d, 0); 1052 s->d->props->power_ctrl(s->d, 0);
1054 1053
1055 mutex_unlock(&s->v4l2_lock); 1054 mutex_unlock(&s->v4l2_lock);
1056
1057 return 0;
1058} 1055}
1059 1056
1060static struct vb2_ops rtl2832_sdr_vb2_ops = { 1057static struct vb2_ops rtl2832_sdr_vb2_ops = {
diff --git a/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c b/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c
index 2cbe088f1697..b8ff113c20f4 100644
--- a/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c
+++ b/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c
@@ -745,14 +745,13 @@ static int solo_enc_start_streaming(struct vb2_queue *q, unsigned int count)
745 return solo_ring_start(solo_enc->solo_dev); 745 return solo_ring_start(solo_enc->solo_dev);
746} 746}
747 747
748static int solo_enc_stop_streaming(struct vb2_queue *q) 748static void solo_enc_stop_streaming(struct vb2_queue *q)
749{ 749{
750 struct solo_enc_dev *solo_enc = vb2_get_drv_priv(q); 750 struct solo_enc_dev *solo_enc = vb2_get_drv_priv(q);
751 751
752 solo_enc_off(solo_enc); 752 solo_enc_off(solo_enc);
753 INIT_LIST_HEAD(&solo_enc->vidq_active); 753 INIT_LIST_HEAD(&solo_enc->vidq_active);
754 solo_ring_stop(solo_enc->solo_dev); 754 solo_ring_stop(solo_enc->solo_dev);
755 return 0;
756} 755}
757 756
758static struct vb2_ops solo_enc_video_qops = { 757static struct vb2_ops solo_enc_video_qops = {
diff --git a/drivers/staging/media/solo6x10/solo6x10-v4l2.c b/drivers/staging/media/solo6x10/solo6x10-v4l2.c
index 1815f765d033..5d0100eb38e6 100644
--- a/drivers/staging/media/solo6x10/solo6x10-v4l2.c
+++ b/drivers/staging/media/solo6x10/solo6x10-v4l2.c
@@ -336,13 +336,12 @@ static int solo_start_streaming(struct vb2_queue *q, unsigned int count)
336 return solo_start_thread(solo_dev); 336 return solo_start_thread(solo_dev);
337} 337}
338 338
339static int solo_stop_streaming(struct vb2_queue *q) 339static void solo_stop_streaming(struct vb2_queue *q)
340{ 340{
341 struct solo_dev *solo_dev = vb2_get_drv_priv(q); 341 struct solo_dev *solo_dev = vb2_get_drv_priv(q);
342 342
343 solo_stop_thread(solo_dev); 343 solo_stop_thread(solo_dev);
344 INIT_LIST_HEAD(&solo_dev->vidq_active); 344 INIT_LIST_HEAD(&solo_dev->vidq_active);
345 return 0;
346} 345}
347 346
348static void solo_buf_queue(struct vb2_buffer *vb) 347static void solo_buf_queue(struct vb2_buffer *vb)
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index 46e76096c22a..bca25dc53f9d 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -324,7 +324,7 @@ struct vb2_ops {
324 void (*buf_cleanup)(struct vb2_buffer *vb); 324 void (*buf_cleanup)(struct vb2_buffer *vb);
325 325
326 int (*start_streaming)(struct vb2_queue *q, unsigned int count); 326 int (*start_streaming)(struct vb2_queue *q, unsigned int count);
327 int (*stop_streaming)(struct vb2_queue *q); 327 void (*stop_streaming)(struct vb2_queue *q);
328 328
329 void (*buf_queue)(struct vb2_buffer *vb); 329 void (*buf_queue)(struct vb2_buffer *vb);
330}; 330};