aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/pwc/pwc-if.c
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 /drivers/media/usb/pwc/pwc-if.c
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>
Diffstat (limited to 'drivers/media/usb/pwc/pwc-if.c')
-rw-r--r--drivers/media/usb/pwc/pwc-if.c7
1 files changed, 2 insertions, 5 deletions
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 = {