]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
[media] vb2: stop_streaming should return void
authorHans Verkuil <hans.verkuil@cisco.com>
Thu, 17 Apr 2014 05:47:21 +0000 (02:47 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 23 Apr 2014 13:12:51 +0000 (10:12 -0300)
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>
41 files changed:
Documentation/video4linux/v4l2-pci-skeleton.c
drivers/media/pci/sta2x11/sta2x11_vip.c
drivers/media/platform/blackfin/bfin_capture.c
drivers/media/platform/coda.c
drivers/media/platform/davinci/vpbe_display.c
drivers/media/platform/davinci/vpif_capture.c
drivers/media/platform/davinci/vpif_display.c
drivers/media/platform/exynos-gsc/gsc-m2m.c
drivers/media/platform/exynos4-is/fimc-capture.c
drivers/media/platform/exynos4-is/fimc-isp-video.c
drivers/media/platform/exynos4-is/fimc-lite.c
drivers/media/platform/exynos4-is/fimc-m2m.c
drivers/media/platform/marvell-ccic/mcam-core.c
drivers/media/platform/mem2mem_testdev.c
drivers/media/platform/s3c-camif/camif-capture.c
drivers/media/platform/s5p-jpeg/jpeg-core.c
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
drivers/media/platform/s5p-tv/mixer_video.c
drivers/media/platform/soc_camera/atmel-isi.c
drivers/media/platform/soc_camera/mx2_camera.c
drivers/media/platform/soc_camera/mx3_camera.c
drivers/media/platform/soc_camera/rcar_vin.c
drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
drivers/media/platform/vivi.c
drivers/media/platform/vsp1/vsp1_video.c
drivers/media/usb/em28xx/em28xx-v4l.h
drivers/media/usb/em28xx/em28xx-video.c
drivers/media/usb/pwc/pwc-if.c
drivers/media/usb/s2255/s2255drv.c
drivers/media/usb/stk1160/stk1160-v4l.c
drivers/media/usb/usbtv/usbtv-video.c
drivers/media/v4l2-core/videobuf2-core.c
drivers/staging/media/davinci_vpfe/vpfe_video.c
drivers/staging/media/dt3155v4l/dt3155v4l.c
drivers/staging/media/go7007/go7007-v4l2.c
drivers/staging/media/msi3101/sdr-msi3101.c
drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c
drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c
drivers/staging/media/solo6x10/solo6x10-v4l2.c
include/media/videobuf2-core.h

index 80251dc2c6cf85662f98763648a42fd802160eff..53dd346586f6cec197a760b0ad1d82d7c9820305 100644 (file)
@@ -269,7 +269,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
  * Stop the DMA engine. Any remaining buffers in the DMA queue are dequeued
  * and passed on to the vb2 framework marked as STATE_ERROR.
  */
-static int stop_streaming(struct vb2_queue *vq)
+static void stop_streaming(struct vb2_queue *vq)
 {
        struct skeleton *skel = vb2_get_drv_priv(vq);
 
@@ -277,7 +277,6 @@ static int stop_streaming(struct vb2_queue *vq)
 
        /* Release all active buffers */
        return_all_buffers(skel, VB2_BUF_STATE_ERROR);
-       return 0;
 }
 
 /*
index bb11443ed63e840b9bdd933e3aa4fdaaa1aa3330..7559951b2ea4d1c25bc8944d34eceb076a097b14 100644 (file)
@@ -357,7 +357,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
 }
 
 /* abort streaming and wait for last buffer */
-static int stop_streaming(struct vb2_queue *vq)
+static void stop_streaming(struct vb2_queue *vq)
 {
        struct sta2x11_vip *vip = vb2_get_drv_priv(vq);
        struct vip_buffer *vip_buf, *node;
@@ -374,7 +374,6 @@ static int stop_streaming(struct vb2_queue *vq)
                list_del(&vip_buf->list);
        }
        spin_unlock(&vip->lock);
-       return 0;
 }
 
 static struct vb2_ops vip_video_qops = {
index 200bec91182e9179d1e3c1acabc75eed1b70d3c2..dfb09d4ee6d11189672312828afc679d3454197c 100644 (file)
@@ -427,7 +427,7 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
        return 0;
 }
 
-static int bcap_stop_streaming(struct vb2_queue *vq)
+static void bcap_stop_streaming(struct vb2_queue *vq)
 {
        struct bcap_device *bcap_dev = vb2_get_drv_priv(vq);
        struct ppi_if *ppi = bcap_dev->ppi;
@@ -452,7 +452,6 @@ static int bcap_stop_streaming(struct vb2_queue *vq)
                list_del(&bcap_dev->cur_frm->list);
                vb2_buffer_done(&bcap_dev->cur_frm->vb, VB2_BUF_STATE_ERROR);
        }
-       return 0;
 }
 
 static struct vb2_ops bcap_video_qops = {
index 3e5199ee5d2503c57f37276748f527aa00e8cc18..d9b1a0409076872b9a0f0859825dbdef846094a3 100644 (file)
@@ -2269,7 +2269,7 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count)
        return ret;
 }
 
-static int coda_stop_streaming(struct vb2_queue *q)
+static void coda_stop_streaming(struct vb2_queue *q)
 {
        struct coda_ctx *ctx = vb2_get_drv_priv(q);
        struct coda_dev *dev = ctx->dev;
@@ -2295,8 +2295,6 @@ static int coda_stop_streaming(struct vb2_queue *q)
                        ctx->bitstream.vaddr, ctx->bitstream.size);
                ctx->runcounter = 0;
        }
-
-       return 0;
 }
 
 static struct vb2_ops coda_qops = {
index a9ad949d0c199260b36fdc00d9b042daa81f8998..4025b1b8aff47e8f0c0fd651ccc67624e1dc38c8 100644 (file)
@@ -368,7 +368,7 @@ static int vpbe_start_streaming(struct vb2_queue *vq, unsigned int count)
        return ret;
 }
 
-static int vpbe_stop_streaming(struct vb2_queue *vq)
+static void vpbe_stop_streaming(struct vb2_queue *vq)
 {
        struct vpbe_fh *fh = vb2_get_drv_priv(vq);
        struct vpbe_layer *layer = fh->layer;
@@ -376,7 +376,7 @@ static int vpbe_stop_streaming(struct vb2_queue *vq)
        unsigned long flags;
 
        if (!vb2_is_streaming(vq))
-               return 0;
+               return;
 
        /* release all active buffers */
        spin_lock_irqsave(&disp->dma_queue_lock, flags);
@@ -398,7 +398,6 @@ static int vpbe_stop_streaming(struct vb2_queue *vq)
                vb2_buffer_done(&layer->next_frm->vb, VB2_BUF_STATE_ERROR);
        }
        spin_unlock_irqrestore(&disp->dma_queue_lock, flags);
-       return 0;
 }
 
 static struct vb2_ops video_qops = {
index 8dea0b84a3ad66788ab29b2437303ebd3bc38d6f..d09a27a23c5d74361677680c3ed8422ce73af06a 100644 (file)
@@ -346,7 +346,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
 }
 
 /* abort streaming and wait for last buffer */
-static int vpif_stop_streaming(struct vb2_queue *vq)
+static void vpif_stop_streaming(struct vb2_queue *vq)
 {
        struct vpif_fh *fh = vb2_get_drv_priv(vq);
        struct channel_obj *ch = fh->channel;
@@ -354,7 +354,7 @@ static int vpif_stop_streaming(struct vb2_queue *vq)
        unsigned long flags;
 
        if (!vb2_is_streaming(vq))
-               return 0;
+               return;
 
        common = &ch->common[VPIF_VIDEO_INDEX];
 
@@ -390,8 +390,6 @@ static int vpif_stop_streaming(struct vb2_queue *vq)
                vb2_buffer_done(&common->next_frm->vb, VB2_BUF_STATE_ERROR);
        }
        spin_unlock_irqrestore(&common->irqlock, flags);
-
-       return 0;
 }
 
 static struct vb2_ops video_qops = {
index aed41edd050102e89248cecbb2607a4f45e6eb12..d03487fb1888b201f918fd9059ce2f6b4e01a905 100644 (file)
@@ -308,7 +308,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
 }
 
 /* abort streaming and wait for last buffer */
-static int vpif_stop_streaming(struct vb2_queue *vq)
+static void vpif_stop_streaming(struct vb2_queue *vq)
 {
        struct vpif_fh *fh = vb2_get_drv_priv(vq);
        struct channel_obj *ch = fh->channel;
@@ -316,7 +316,7 @@ static int vpif_stop_streaming(struct vb2_queue *vq)
        unsigned long flags;
 
        if (!vb2_is_streaming(vq))
-               return 0;
+               return;
 
        common = &ch->common[VPIF_VIDEO_INDEX];
 
@@ -352,8 +352,6 @@ static int vpif_stop_streaming(struct vb2_queue *vq)
                vb2_buffer_done(&common->next_frm->vb, VB2_BUF_STATE_ERROR);
        }
        spin_unlock_irqrestore(&common->irqlock, flags);
-
-       return 0;
 }
 
 static struct vb2_ops video_qops = {
index d0ea94f58d6f5ce84e05dfc6efcdfd49f48f74ff..e434f1f03d7b3a4458e0543923d9189b2992b8a3 100644 (file)
@@ -66,15 +66,13 @@ static int gsc_m2m_start_streaming(struct vb2_queue *q, unsigned int count)
        return ret > 0 ? 0 : ret;
 }
 
-static int gsc_m2m_stop_streaming(struct vb2_queue *q)
+static void gsc_m2m_stop_streaming(struct vb2_queue *q)
 {
        struct gsc_ctx *ctx = q->drv_priv;
 
        __gsc_m2m_job_abort(ctx);
 
        pm_runtime_put(&ctx->gsc_dev->pdev->dev);
-
-       return 0;
 }
 
 void gsc_m2m_job_finish(struct gsc_ctx *ctx, int vb_state)
index 92ae812abce273690ea1cc4e0cd55f73cf3a66c0..3d2babd5067af38e32c1f575d6b94d71af88660f 100644 (file)
@@ -294,15 +294,15 @@ static int start_streaming(struct vb2_queue *q, unsigned int count)
        return 0;
 }
 
-static int stop_streaming(struct vb2_queue *q)
+static void stop_streaming(struct vb2_queue *q)
 {
        struct fimc_ctx *ctx = q->drv_priv;
        struct fimc_dev *fimc = ctx->fimc_dev;
 
        if (!fimc_capture_active(fimc))
-               return -EINVAL;
+               return;
 
-       return fimc_stop_capture(fimc, false);
+       fimc_stop_capture(fimc, false);
 }
 
 int fimc_capture_suspend(struct fimc_dev *fimc)
index e92b4e115adbbaf63337bb8a183ef7f60cf93581..ced46600e3436d33b4d85f9414e33faaf8e1788c 100644 (file)
@@ -125,7 +125,7 @@ static int isp_video_capture_start_streaming(struct vb2_queue *q,
        return ret;
 }
 
-static int isp_video_capture_stop_streaming(struct vb2_queue *q)
+static void isp_video_capture_stop_streaming(struct vb2_queue *q)
 {
        struct fimc_isp *isp = vb2_get_drv_priv(q);
        struct fimc_is *is = fimc_isp_to_is(isp);
@@ -134,7 +134,7 @@ static int isp_video_capture_stop_streaming(struct vb2_queue *q)
 
        ret = fimc_pipeline_call(&isp->video_capture.ve, set_stream, 0);
        if (ret < 0)
-               return ret;
+               return;
 
        dma->cmd = DMA_OUTPUT_COMMAND_DISABLE;
        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)
        clear_bit(ST_ISP_VID_CAP_STREAMING, &isp->state);
 
        isp->video_capture.buf_count = 0;
-       return 0;
 }
 
 static int isp_video_capture_buffer_prepare(struct vb2_buffer *vb)
index 3ad660b55b6bdc948ecd97623eccce05f79efcbb..630aef52dbb81df1c58100a3c81c4a7c3c0cf12e 100644 (file)
@@ -350,14 +350,14 @@ static int start_streaming(struct vb2_queue *q, unsigned int count)
        return 0;
 }
 
-static int stop_streaming(struct vb2_queue *q)
+static void stop_streaming(struct vb2_queue *q)
 {
        struct fimc_lite *fimc = q->drv_priv;
 
        if (!fimc_lite_active(fimc))
-               return -EINVAL;
+               return;
 
-       return fimc_lite_stop_capture(fimc, false);
+       fimc_lite_stop_capture(fimc, false);
 }
 
 static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
index 36971d915b530ac3ee284ec80d892459ef7e7333..d314155da9e4afed19bae48ac6e2e8a9e58e082f 100644 (file)
@@ -85,7 +85,7 @@ static int start_streaming(struct vb2_queue *q, unsigned int count)
        return ret > 0 ? 0 : ret;
 }
 
-static int stop_streaming(struct vb2_queue *q)
+static void stop_streaming(struct vb2_queue *q)
 {
        struct fimc_ctx *ctx = q->drv_priv;
        int ret;
@@ -95,7 +95,6 @@ static int stop_streaming(struct vb2_queue *q)
                fimc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
 
        pm_runtime_put(&ctx->fimc_dev->pdev->dev);
-       return 0;
 }
 
 static void fimc_device_run(void *priv)
index 8b34c485be799b8f0b2dc4c2e2fadc7de342874a..be4b51212106e41d1420b6c27b1fb68c041782cc 100644 (file)
@@ -1156,7 +1156,7 @@ static int mcam_vb_start_streaming(struct vb2_queue *vq, unsigned int count)
        return mcam_read_setup(cam);
 }
 
-static int mcam_vb_stop_streaming(struct vb2_queue *vq)
+static void mcam_vb_stop_streaming(struct vb2_queue *vq)
 {
        struct mcam_camera *cam = vb2_get_drv_priv(vq);
        unsigned long flags;
@@ -1164,10 +1164,10 @@ static int mcam_vb_stop_streaming(struct vb2_queue *vq)
        if (cam->state == S_BUFWAIT) {
                /* They never gave us buffers */
                cam->state = S_IDLE;
-               return 0;
+               return;
        }
        if (cam->state != S_STREAMING)
-               return -EINVAL;
+               return;
        mcam_ctlr_stop_dma(cam);
        /*
         * Reset the CCIC PHY after stopping streaming,
@@ -1182,7 +1182,6 @@ static int mcam_vb_stop_streaming(struct vb2_queue *vq)
        spin_lock_irqsave(&cam->dev_lock, flags);
        INIT_LIST_HEAD(&cam->buffers);
        spin_unlock_irqrestore(&cam->dev_lock, flags);
-       return 0;
 }
 
 
index 4f3096b170665e15329c25035248b207d3b7d276..0714070ed7fab4ea5fd90597c1c130979c486916 100644 (file)
@@ -787,7 +787,7 @@ static int m2mtest_start_streaming(struct vb2_queue *q, unsigned count)
        return 0;
 }
 
-static int m2mtest_stop_streaming(struct vb2_queue *q)
+static void m2mtest_stop_streaming(struct vb2_queue *q)
 {
        struct m2mtest_ctx *ctx = vb2_get_drv_priv(q);
        struct vb2_buffer *vb;
@@ -799,12 +799,11 @@ static int m2mtest_stop_streaming(struct vb2_queue *q)
                else
                        vb = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
                if (vb == NULL)
-                       return 0;
+                       return;
                spin_lock_irqsave(&ctx->dev->irqlock, flags);
                v4l2_m2m_buf_done(vb, VB2_BUF_STATE_ERROR);
                spin_unlock_irqrestore(&ctx->dev->irqlock, flags);
        }
-       return 0;
 }
 
 static struct vb2_ops m2mtest_qops = {
index 4e4d1631e0423659bd3d7c6bc18852058c8193b3..deba425e3d8f61ecee4d57c1357036300c14e092 100644 (file)
@@ -435,10 +435,10 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
        return 0;
 }
 
-static int stop_streaming(struct vb2_queue *vq)
+static void stop_streaming(struct vb2_queue *vq)
 {
        struct camif_vp *vp = vb2_get_drv_priv(vq);
-       return camif_stop_capture(vp);
+       camif_stop_capture(vp);
 }
 
 static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
index 8a18972012f7e00562c061cad66514e2588df876..368b3f6df24bbc31e8f0e7761e83a5e9adc31f30 100644 (file)
@@ -1670,13 +1670,11 @@ static int s5p_jpeg_start_streaming(struct vb2_queue *q, unsigned int count)
        return ret > 0 ? 0 : ret;
 }
 
-static int s5p_jpeg_stop_streaming(struct vb2_queue *q)
+static void s5p_jpeg_stop_streaming(struct vb2_queue *q)
 {
        struct s5p_jpeg_ctx *ctx = vb2_get_drv_priv(q);
 
        pm_runtime_put(ctx->jpeg->dev);
-
-       return 0;
 }
 
 static struct vb2_ops s5p_jpeg_qops = {
index 8faf9691712dd8febd2c06abecd5e8b2cff29068..58b7bbaa2da00a97360b6dd687ef74a2235f75cc 100644 (file)
@@ -1027,7 +1027,7 @@ static int s5p_mfc_start_streaming(struct vb2_queue *q, unsigned int count)
        return 0;
 }
 
-static int s5p_mfc_stop_streaming(struct vb2_queue *q)
+static void s5p_mfc_stop_streaming(struct vb2_queue *q)
 {
        unsigned long flags;
        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)
        }
        if (aborted)
                ctx->state = MFCINST_RUNNING;
-       return 0;
 }
 
 
index df83cd157babf953b15b4dd323f87e08e5ccb6d4..458279e5dc80c0296e808f8529eaba0a36d50be9 100644 (file)
@@ -1954,7 +1954,7 @@ static int s5p_mfc_start_streaming(struct vb2_queue *q, unsigned int count)
        return 0;
 }
 
-static int s5p_mfc_stop_streaming(struct vb2_queue *q)
+static void s5p_mfc_stop_streaming(struct vb2_queue *q)
 {
        unsigned long flags;
        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)
                ctx->src_queue_cnt = 0;
        }
        spin_unlock_irqrestore(&dev->irqlock, flags);
-       return 0;
 }
 
 static void s5p_mfc_buf_queue(struct vb2_buffer *vb)
index a1ce55fd30f360cb77a4c98a324f027cb7136c09..9f1e52f0bd094fb70250adf9f8014c28890a7367 100644 (file)
@@ -985,7 +985,7 @@ static void mxr_watchdog(unsigned long arg)
        spin_unlock_irqrestore(&layer->enq_slock, flags);
 }
 
-static int stop_streaming(struct vb2_queue *vq)
+static void stop_streaming(struct vb2_queue *vq)
 {
        struct mxr_layer *layer = vb2_get_drv_priv(vq);
        struct mxr_device *mdev = layer->mdev;
@@ -1031,7 +1031,6 @@ static int stop_streaming(struct vb2_queue *vq)
        mxr_streamer_put(mdev);
        /* allow changes in output configuration */
        mxr_output_put(mdev);
-       return 0;
 }
 
 static struct vb2_ops mxr_video_qops = {
index f0b6c900034d9c25092abebdc0f48ee2a3a8328d..38c723aca438fc09a484570c70f066b9a382caa7 100644 (file)
@@ -406,7 +406,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
 }
 
 /* abort streaming and wait for last buffer */
-static int stop_streaming(struct vb2_queue *vq)
+static void stop_streaming(struct vb2_queue *vq)
 {
        struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
        struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
@@ -433,7 +433,7 @@ static int stop_streaming(struct vb2_queue *vq)
        if (time_after(jiffies, timeout)) {
                dev_err(icd->parent,
                        "Timeout waiting for finishing codec request\n");
-               return -ETIMEDOUT;
+               return;
        }
 
        /* Disable interrupts */
@@ -444,8 +444,6 @@ static int stop_streaming(struct vb2_queue *vq)
        ret = atmel_isi_wait_status(isi, WAIT_ISI_DISABLE);
        if (ret < 0)
                dev_err(icd->parent, "Disable ISI timed out\n");
-
-       return ret;
 }
 
 static struct vb2_ops isi_video_qops = {
index 3e844803bdca113d215ac0c68e7ab109ea7452ad..b40bc2e5ba47d6cbcf8ec942adc53a0797970ac7 100644 (file)
@@ -741,7 +741,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
        return 0;
 }
 
-static int mx2_stop_streaming(struct vb2_queue *q)
+static void mx2_stop_streaming(struct vb2_queue *q)
 {
        struct soc_camera_device *icd = soc_camera_from_vb2q(q);
        struct soc_camera_host *ici =
@@ -773,8 +773,6 @@ static int mx2_stop_streaming(struct vb2_queue *q)
 
        dma_free_coherent(ici->v4l2_dev.dev,
                          pcdev->discard_size, b, pcdev->discard_buffer_dma);
-
-       return 0;
 }
 
 static struct vb2_ops mx2_videobuf_ops = {
index 9ed81ac6881c44d9fe53b545bded42e828363377..83315dfeef6202b6fa9d4109a989020a035b9476 100644 (file)
@@ -406,7 +406,7 @@ static int mx3_videobuf_init(struct vb2_buffer *vb)
        return 0;
 }
 
-static int mx3_stop_streaming(struct vb2_queue *q)
+static void mx3_stop_streaming(struct vb2_queue *q)
 {
        struct soc_camera_device *icd = soc_camera_from_vb2q(q);
        struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
@@ -430,8 +430,6 @@ static int mx3_stop_streaming(struct vb2_queue *q)
        }
 
        spin_unlock_irqrestore(&mx3_cam->lock, flags);
-
-       return 0;
 }
 
 static struct vb2_ops mx3_videobuf_ops = {
index 704eee766487394a815bbc049c018e45f6269860..e594230e84d3c903fc9ecc465926109a01bc3f51 100644 (file)
@@ -513,7 +513,7 @@ static int rcar_vin_videobuf_init(struct vb2_buffer *vb)
        return 0;
 }
 
-static int rcar_vin_stop_streaming(struct vb2_queue *vq)
+static void rcar_vin_stop_streaming(struct vb2_queue *vq)
 {
        struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
        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)
        list_for_each_safe(buf_head, tmp, &priv->capture)
                list_del_init(buf_head);
        spin_unlock_irq(&priv->lock);
-
-       return 0;
 }
 
 static struct vb2_ops rcar_vin_vb2_ops = {
index 3e75a469cd49ff64d7301c9854dd4ac451b57e04..20ad4a571d3739ad5a9312b957c9f902ff8a5efd 100644 (file)
@@ -471,7 +471,7 @@ static int sh_mobile_ceu_videobuf_init(struct vb2_buffer *vb)
        return 0;
 }
 
-static int sh_mobile_ceu_stop_streaming(struct vb2_queue *q)
+static void sh_mobile_ceu_stop_streaming(struct vb2_queue *q)
 {
        struct soc_camera_device *icd = container_of(q, struct soc_camera_device, vb2_vidq);
        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)
 
        spin_unlock_irq(&pcdev->lock);
 
-       return sh_mobile_ceu_soft_reset(pcdev);
+       sh_mobile_ceu_soft_reset(pcdev);
 }
 
 static struct vb2_ops sh_mobile_ceu_videobuf_ops = {
index 3890f4f42a78af6f3cf29042fcf1c00b22297023..d00bf3df0f8a0bf6bf34996fa454ffdbd763d7e1 100644 (file)
@@ -906,12 +906,11 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
 }
 
 /* abort streaming and wait for last buffer */
-static int stop_streaming(struct vb2_queue *vq)
+static void stop_streaming(struct vb2_queue *vq)
 {
        struct vivi_dev *dev = vb2_get_drv_priv(vq);
        dprintk(dev, 1, "%s\n", __func__);
        vivi_stop_generating(dev);
-       return 0;
 }
 
 static void vivi_lock(struct vb2_queue *vq)
index b48f135ffc014e802d7b90e860f12285b9025c73..a0595c17700fa3616cff66d1c0991d342906c7a7 100644 (file)
@@ -720,7 +720,7 @@ static int vsp1_video_start_streaming(struct vb2_queue *vq, unsigned int count)
        return 0;
 }
 
-static int vsp1_video_stop_streaming(struct vb2_queue *vq)
+static void vsp1_video_stop_streaming(struct vb2_queue *vq)
 {
        struct vsp1_video *video = vb2_get_drv_priv(vq);
        struct vsp1_pipeline *pipe = to_vsp1_pipeline(&video->video.entity);
@@ -743,8 +743,6 @@ static int vsp1_video_stop_streaming(struct vb2_queue *vq)
        spin_lock_irqsave(&video->irqlock, flags);
        INIT_LIST_HEAD(&video->irqqueue);
        spin_unlock_irqrestore(&video->irqlock, flags);
-
-       return 0;
 }
 
 static struct vb2_ops vsp1_video_queue_qops = {
index bce438691e0ebd6a5c449e5c7a57dc52aec478fb..432862c20bbf43d51b26b857ce33ed43bf22fca1 100644 (file)
@@ -16,5 +16,5 @@
 
 
 int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count);
-int em28xx_stop_vbi_streaming(struct vb2_queue *vq);
+void em28xx_stop_vbi_streaming(struct vb2_queue *vq);
 extern struct vb2_ops em28xx_vbi_qops;
index 0856e5d367b6d9a7c495dfd9223eb7acf527ed05..cdcd7513e6ec7f9201827f3f7de141a8f5634697 100644 (file)
@@ -937,7 +937,7 @@ int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count)
        return rc;
 }
 
-static int em28xx_stop_streaming(struct vb2_queue *vq)
+static void em28xx_stop_streaming(struct vb2_queue *vq)
 {
        struct em28xx *dev = vb2_get_drv_priv(vq);
        struct em28xx_dmaqueue *vidq = &dev->vidq;
@@ -961,11 +961,9 @@ static int em28xx_stop_streaming(struct vb2_queue *vq)
        }
        dev->usb_ctl.vid_buf = NULL;
        spin_unlock_irqrestore(&dev->slock, flags);
-
-       return 0;
 }
 
-int em28xx_stop_vbi_streaming(struct vb2_queue *vq)
+void em28xx_stop_vbi_streaming(struct vb2_queue *vq)
 {
        struct em28xx *dev = vb2_get_drv_priv(vq);
        struct em28xx_dmaqueue *vbiq = &dev->vbiq;
@@ -989,8 +987,6 @@ int em28xx_stop_vbi_streaming(struct vb2_queue *vq)
        }
        dev->usb_ctl.vbi_buf = NULL;
        spin_unlock_irqrestore(&dev->slock, flags);
-
-       return 0;
 }
 
 static void
index 84a6720b1d00064c55be2f9f2cdd0a112be35df3..a73b0bced96f7b6880cbbf6f48df3e68e1a026dd 100644 (file)
@@ -681,12 +681,11 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
        return r;
 }
 
-static int stop_streaming(struct vb2_queue *vq)
+static void stop_streaming(struct vb2_queue *vq)
 {
        struct pwc_device *pdev = vb2_get_drv_priv(vq);
 
-       if (mutex_lock_interruptible(&pdev->v4l2_lock))
-               return -ERESTARTSYS;
+       mutex_lock(&pdev->v4l2_lock);
        if (pdev->udev) {
                pwc_set_leds(pdev, 0, 0);
                pwc_camera_power(pdev, 0);
@@ -695,8 +694,6 @@ static int stop_streaming(struct vb2_queue *vq)
 
        pwc_cleanup_queued_bufs(pdev);
        mutex_unlock(&pdev->v4l2_lock);
-
-       return 0;
 }
 
 static struct vb2_ops pwc_vb_queue_ops = {
index 1d4ba2b804908f9373de73100ccca4289032295b..e019dd63ed42f7db07f8cbc3e0f557e272326530 100644 (file)
@@ -714,7 +714,7 @@ static void buffer_queue(struct vb2_buffer *vb)
 }
 
 static int start_streaming(struct vb2_queue *vq, unsigned int count);
-static int stop_streaming(struct vb2_queue *vq);
+static void stop_streaming(struct vb2_queue *vq);
 
 static struct vb2_ops s2255_video_qops = {
        .queue_setup = queue_setup,
@@ -1109,7 +1109,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
 }
 
 /* abort streaming and wait for last buffer */
-static int stop_streaming(struct vb2_queue *vq)
+static void stop_streaming(struct vb2_queue *vq)
 {
        struct s2255_vc *vc = vb2_get_drv_priv(vq);
        struct s2255_buffer *buf, *node;
@@ -1123,7 +1123,6 @@ static int stop_streaming(struct vb2_queue *vq)
                        buf, buf->vb.v4l2_buf.index);
        }
        spin_unlock_irqrestore(&vc->qlock, flags);
-       return 0;
 }
 
 static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id i)
index 37bc00f418f1db47272238d90830ed2a7ac1f872..46e8a5069b37039fe0141daf174046d4fa38e6e0 100644 (file)
@@ -583,10 +583,10 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
 }
 
 /* abort streaming and wait for last buffer */
-static int stop_streaming(struct vb2_queue *vq)
+static void stop_streaming(struct vb2_queue *vq)
 {
        struct stk1160 *dev = vb2_get_drv_priv(vq);
-       return stk1160_stop_streaming(dev);
+       stk1160_stop_streaming(dev);
 }
 
 static struct vb2_ops stk1160_video_qops = {
index 20365bd69d05de0a4aabd8dae897d07b4cad293b..2967e808408bb48217a5dba945c06ae5f500fa1d 100644 (file)
@@ -634,15 +634,12 @@ static int usbtv_start_streaming(struct vb2_queue *vq, unsigned int count)
        return usbtv_start(usbtv);
 }
 
-static int usbtv_stop_streaming(struct vb2_queue *vq)
+static void usbtv_stop_streaming(struct vb2_queue *vq)
 {
        struct usbtv *usbtv = vb2_get_drv_priv(vq);
 
-       if (usbtv->udev == NULL)
-               return -ENODEV;
-
-       usbtv_stop(usbtv);
-       return 0;
+       if (usbtv->udev)
+               usbtv_stop(usbtv);
 }
 
 static struct vb2_ops usbtv_vb2_ops = {
index 3f0cdb150dfd85a5b89a3b97f64f5e2dc63d4886..f8f694a239f87db9e8c13254106c6db7933ce0b6 100644 (file)
@@ -2086,7 +2086,7 @@ static void __vb2_queue_cancel(struct vb2_queue *q)
         * buffers.
         */
        if (q->start_streaming_called)
-               call_qop(q, stop_streaming, q);
+               call_void_qop(q, stop_streaming, q);
        q->streaming = 0;
        q->start_streaming_called = 0;
        q->queued_count = 0;
index 9337d92c5939521329d743bde0d0fd60044db741..7b213a7f96239ebf00d5222a5ca6286f98103347 100644 (file)
@@ -1249,7 +1249,7 @@ static int vpfe_buffer_init(struct vb2_buffer *vb)
 }
 
 /* abort streaming and wait for last buffer */
-static int vpfe_stop_streaming(struct vb2_queue *vq)
+static void vpfe_stop_streaming(struct vb2_queue *vq)
 {
        struct vpfe_fh *fh = vb2_get_drv_priv(vq);
        struct vpfe_video_device *video = fh->video;
@@ -1272,7 +1272,6 @@ static int vpfe_stop_streaming(struct vb2_queue *vq)
                list_del(&video->next_frm->list);
                vb2_buffer_done(&video->next_frm->vb, VB2_BUF_STATE_ERROR);
        }
-       return 0;
 }
 
 static void vpfe_buf_cleanup(struct vb2_buffer *vb)
index afbc2e51960619f6b53bcdf962ed2a9ed88f70fe..14bdc19ec48fad74058138672aebdd8de6b82951 100644 (file)
@@ -262,7 +262,7 @@ dt3155_buf_prepare(struct vb2_buffer *vb)
        return 0;
 }
 
-static int
+static void
 dt3155_stop_streaming(struct vb2_queue *q)
 {
        struct dt3155_priv *pd = vb2_get_drv_priv(q);
@@ -276,7 +276,6 @@ dt3155_stop_streaming(struct vb2_queue *q)
        }
        spin_unlock_irq(&pd->lock);
        msleep(45); /* irq hendler will stop the hardware */
-       return 0;
 }
 
 static void
index b397aa3c0f443c0ae5ae138f09f0a30a70463fd3..090b3e6e852a1cdb6c912427a536e3cd591d23ef 100644 (file)
@@ -516,7 +516,7 @@ static int go7007_start_streaming(struct vb2_queue *q, unsigned int count)
        return ret;
 }
 
-static int go7007_stop_streaming(struct vb2_queue *q)
+static void go7007_stop_streaming(struct vb2_queue *q)
 {
        struct go7007 *go = vb2_get_drv_priv(q);
        unsigned long flags;
@@ -538,7 +538,6 @@ static int go7007_stop_streaming(struct vb2_queue *q)
        /* Turn on Capture LED */
        if (go->board_id == GO7007_BOARDID_ADS_USBAV_709)
                go7007_write_addr(go, 0x3c82, 0x000d);
-       return 0;
 }
 
 static struct vb2_ops go7007_video_qops = {
index 65d351f99da2e48607d3f8e1c0d6ff84ba8af17f..08d0d096b8810532cc643b7355ce9187cd9923da 100644 (file)
@@ -1074,14 +1074,13 @@ static int msi3101_start_streaming(struct vb2_queue *vq, unsigned int count)
        return ret;
 }
 
-static int msi3101_stop_streaming(struct vb2_queue *vq)
+static void msi3101_stop_streaming(struct vb2_queue *vq)
 {
        struct msi3101_state *s = vb2_get_drv_priv(vq);
-       int ret;
+
        dev_dbg(&s->udev->dev, "%s:\n", __func__);
 
-       if (mutex_lock_interruptible(&s->v4l2_lock))
-               return -ERESTARTSYS;
+       mutex_lock(&s->v4l2_lock);
 
        if (s->udev)
                msi3101_isoc_cleanup(s);
@@ -1090,22 +1089,15 @@ static int msi3101_stop_streaming(struct vb2_queue *vq)
 
        /* according to tests, at least 700us delay is required  */
        msleep(20);
-       ret = msi3101_ctrl_msg(s, CMD_STOP_STREAMING, 0);
-       if (ret)
-               goto err_sleep_tuner;
-
-       /* sleep USB IF / ADC */
-       ret = msi3101_ctrl_msg(s, CMD_WREG, 0x01000003);
-       if (ret)
-               goto err_sleep_tuner;
+       if (!msi3101_ctrl_msg(s, CMD_STOP_STREAMING, 0)) {
+               /* sleep USB IF / ADC */
+               msi3101_ctrl_msg(s, CMD_WREG, 0x01000003);
+       }
 
-err_sleep_tuner:
        /* sleep tuner */
-       ret = v4l2_subdev_call(s->v4l2_subdev, core, s_power, 0);
+       v4l2_subdev_call(s->v4l2_subdev, core, s_power, 0);
 
        mutex_unlock(&s->v4l2_lock);
-
-       return ret;
 }
 
 static struct vb2_ops msi3101_vb2_ops = {
index 104ee8af79af1f138c2300e3efe9fa9cf3972f29..093df6b6ae35a3ec4c61e4e9d0830662af5e66f8 100644 (file)
@@ -1032,13 +1032,12 @@ static int rtl2832_sdr_start_streaming(struct vb2_queue *vq, unsigned int count)
        return ret;
 }
 
-static int rtl2832_sdr_stop_streaming(struct vb2_queue *vq)
+static void rtl2832_sdr_stop_streaming(struct vb2_queue *vq)
 {
        struct rtl2832_sdr_state *s = vb2_get_drv_priv(vq);
        dev_dbg(&s->udev->dev, "%s:\n", __func__);
 
-       if (mutex_lock_interruptible(&s->v4l2_lock))
-               return -ERESTARTSYS;
+       mutex_lock(&s->v4l2_lock);
 
        rtl2832_sdr_kill_urbs(s);
        rtl2832_sdr_free_urbs(s);
@@ -1053,8 +1052,6 @@ static int rtl2832_sdr_stop_streaming(struct vb2_queue *vq)
                s->d->props->power_ctrl(s->d, 0);
 
        mutex_unlock(&s->v4l2_lock);
-
-       return 0;
 }
 
 static struct vb2_ops rtl2832_sdr_vb2_ops = {
index 2cbe088f16975a3af260cc920946304afc44d05c..b8ff113c20f4b582b7f8d1fbef129894de507a2a 100644 (file)
@@ -745,14 +745,13 @@ static int solo_enc_start_streaming(struct vb2_queue *q, unsigned int count)
        return solo_ring_start(solo_enc->solo_dev);
 }
 
-static int solo_enc_stop_streaming(struct vb2_queue *q)
+static void solo_enc_stop_streaming(struct vb2_queue *q)
 {
        struct solo_enc_dev *solo_enc = vb2_get_drv_priv(q);
 
        solo_enc_off(solo_enc);
        INIT_LIST_HEAD(&solo_enc->vidq_active);
        solo_ring_stop(solo_enc->solo_dev);
-       return 0;
 }
 
 static struct vb2_ops solo_enc_video_qops = {
index 1815f765d033422186cfe7e742bc5bb5de20ee36..5d0100eb38e641229b1dd4666b29ad6328409021 100644 (file)
@@ -336,13 +336,12 @@ static int solo_start_streaming(struct vb2_queue *q, unsigned int count)
        return solo_start_thread(solo_dev);
 }
 
-static int solo_stop_streaming(struct vb2_queue *q)
+static void solo_stop_streaming(struct vb2_queue *q)
 {
        struct solo_dev *solo_dev = vb2_get_drv_priv(q);
 
        solo_stop_thread(solo_dev);
        INIT_LIST_HEAD(&solo_dev->vidq_active);
-       return 0;
 }
 
 static void solo_buf_queue(struct vb2_buffer *vb)
index 46e76096c22aa16bc6922247ebae861600c0b095..bca25dc53f9d204ef0773db521dbeba797705728 100644 (file)
@@ -324,7 +324,7 @@ struct vb2_ops {
        void (*buf_cleanup)(struct vb2_buffer *vb);
 
        int (*start_streaming)(struct vb2_queue *q, unsigned int count);
-       int (*stop_streaming)(struct vb2_queue *q);
+       void (*stop_streaming)(struct vb2_queue *q);
 
        void (*buf_queue)(struct vb2_buffer *vb);
 };